Click here to Skip to main content
15,921,793 members
Home / Discussions / C#
   

C#

 
QuestionCombobox in C# : how to add for each Item a Tag ? Pin
youssef7-Dec-04 12:42
youssef7-Dec-04 12:42 
AnswerRe: Combobox in C# : how to add for each Item a Tag ? Pin
Skynyrd7-Dec-04 13:29
Skynyrd7-Dec-04 13:29 
AnswerRe: Combobox in C# : how to add for each Item a Tag ? Pin
Heath Stewart7-Dec-04 14:47
protectorHeath Stewart7-Dec-04 14:47 
AnswerRe: Combobox in C# : how to add for each Item a Tag ? Pin
Luis Alonso Ramos8-Dec-04 21:24
Luis Alonso Ramos8-Dec-04 21:24 
GeneralDynamicInvoke a remote object Pin
Skynyrd7-Dec-04 12:21
Skynyrd7-Dec-04 12:21 
GeneralRe: DynamicInvoke a remote object Pin
Heath Stewart7-Dec-04 14:48
protectorHeath Stewart7-Dec-04 14:48 
GeneralRe: DynamicInvoke a remote object Pin
Skynyrd8-Dec-04 0:57
Skynyrd8-Dec-04 0:57 
GeneralRe: DynamicInvoke a remote object Pin
Javier Lozano7-Dec-04 15:02
Javier Lozano7-Dec-04 15:02 
The MSDN documentation says the following about the function Delegate.CreateDelegate(Type objType,Object target,string method) method.

A System.ArgumentException is thrown when objType does not inherit from either Delegate or MulticastDelegate OR method is not an instance method. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdelegateclasscreatedelegatetopic.asp[^]

I'm a little confused about your question: Is it possible to invoke a remote object through it's proxy this way?

When you have a remote objet you use its proxy to call its method exactly the same way you would call other objects. For example, say I have an object called myRemoteObject

<br />
using System;<br />
using System.Runtime.Remoting;<br />
<br />
namespace myRemoteService<br />
{<br />
    // Well Known Web Service object<br />
    public class myRemoteObject : MarshalByRefObject<br />
    {<br />
        // Method myRemoteMethod<br />
        public String myRemoteMethod() <br />
        {<br />
           return "Hello World";<br />
        }<br />
    }<br />
}<br />


You can then call the remote object via it's proxy using the following code:

<br />
using System;<br />
using System.Runtime.Remoting;<br />
using myRemoteService;<br />
<br />
public class Client<br />
{<br />
    static void Main(string[] args)<br />
    {<br />
        //Using a configuration file to have less code...<br />
        String filename = "client.exe.config";<br />
        RemotingConfiguration.Configure(filename);<br />
<br />
        myRemoteObject obj = new myRemoteObject();<br />
        Console.WriteLine(obj.myRemoteMethod());<br />
        obj = null;<br />
<br />
        Console.WriteLine("Done...");<br />
    }<br />
}<br />


This will use a generated proxy to call your method.

Did this help at all?

~javier lozano
(blog)
GeneralRe: DynamicInvoke a remote object Pin
Skynyrd8-Dec-04 1:08
Skynyrd8-Dec-04 1:08 
GeneralRe: DynamicInvoke a remote object Pin
Javier Lozano8-Dec-04 5:07
Javier Lozano8-Dec-04 5:07 
GeneralRe: DynamicInvoke a remote object Pin
Heath Stewart8-Dec-04 5:58
protectorHeath Stewart8-Dec-04 5:58 
GeneralRe: DynamicInvoke a remote object Pin
Javier Lozano8-Dec-04 6:03
Javier Lozano8-Dec-04 6:03 
GeneralRe: DynamicInvoke a remote object Pin
Skynyrd8-Dec-04 11:26
Skynyrd8-Dec-04 11:26 
GeneralRe: DynamicInvoke a remote object Pin
Skynyrd8-Dec-04 11:43
Skynyrd8-Dec-04 11:43 
GeneralRe: DynamicInvoke a remote object Pin
Javier Lozano8-Dec-04 12:06
Javier Lozano8-Dec-04 12:06 
GeneralRe: DynamicInvoke a remote object Pin
Skynyrd8-Dec-04 13:18
Skynyrd8-Dec-04 13:18 
GeneralHTML style RichTextBox control Pin
Beringer7-Dec-04 12:06
Beringer7-Dec-04 12:06 
GeneralRe: HTML style RichTextBox control Pin
Beringer7-Dec-04 12:08
Beringer7-Dec-04 12:08 
GeneralRe: HTML style RichTextBox control Pin
Heath Stewart7-Dec-04 14:44
protectorHeath Stewart7-Dec-04 14:44 
GeneralSockets and Win2k Issues Pin
Tristan Rhodes7-Dec-04 11:34
Tristan Rhodes7-Dec-04 11:34 
GeneralRe: Sockets and Win2k Issues Pin
Heath Stewart7-Dec-04 14:27
protectorHeath Stewart7-Dec-04 14:27 
GeneralRe: Sockets and Win2k Issues Pin
Tristan Rhodes8-Dec-04 0:25
Tristan Rhodes8-Dec-04 0:25 
GeneralRe: Sockets and Win2k Issues Pin
Daniel Turini7-Dec-04 20:12
Daniel Turini7-Dec-04 20:12 
GeneralRe: Sockets and Win2k Issues Pin
Tristan Rhodes8-Dec-04 0:26
Tristan Rhodes8-Dec-04 0:26 
GeneralRe: Sockets and Win2k Issues Pin
Heath Stewart8-Dec-04 6:01
protectorHeath Stewart8-Dec-04 6:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.