Re: Late Binding in C#
From: BuddyHome (Buddy_at_onlinehome.com)
Date: 04/02/04
- Next message: BuddyHome: "Re: Why does FALSE return TRUE?"
- Previous message: Jack Smash: "Autoscrolling problem"
- In reply to: Scott English: "Late Binding in C#"
- Next in thread: Scott English: "Re: Late Binding in C#"
- Reply: Scott English: "Re: Late Binding in C#"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 2 Apr 2004 18:39:27 +0100
You will need to Invoke the method. Check out Invoke in MSDN.
Thanks,
"Scott English" <nospam@nospam.com> wrote in message
news:%23b9XwQNGEHA.1396@TK2MSFTNGP11.phx.gbl...
> I am writing an C# program. I call a method on a COM object that returns
> Object. I don't know the type of the object (and reflection just says its
a
> __ComObject), but I know there is supposed to be Controls property. How
can
> I call the Controls property without knowing the type of the object?
>
> In VB.NET, you can just do this if Option Explicit is off by just writing
> SomeObject.Controls. The VB.NET runtime will handle the late binding
which,
> in this case, includes calling the COM object's IDispatch interface. I
> don't see how to do the same thing in C#. The only "late binding"
examples
> I can find for C# assume you know the type of the object you are calling.
>
>
- Next message: BuddyHome: "Re: Why does FALSE return TRUE?"
- Previous message: Jack Smash: "Autoscrolling problem"
- In reply to: Scott English: "Late Binding in C#"
- Next in thread: Scott English: "Re: Late Binding in C#"
- Reply: Scott English: "Re: Late Binding in C#"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|