Re: Late Binding in C#
From: Scott English (nospam_at_nospam.com)
Date: 04/02/04
- Next message: Jon Skeet [C# MVP]: "Re: Problem with UNICODE"
- Previous message: Marina: "Re: When the connection to the database will be destroyed?"
- In reply to: BuddyHome: "Re: Late Binding in C#"
- Next in thread: BuddyHome: "Re: Late Binding in C#"
- Reply: BuddyHome: "Re: Late Binding in C#"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 2 Apr 2004 09:46:40 -0800
Are you refering to MethodBase.Invoke? To get a MethodBase object, you must
first know the type of the object the method is on. Am I missing something?
"BuddyHome" <Buddy@onlinehome.com> wrote in message
news:OgB7wlNGEHA.624@TK2MSFTNGP10.phx.gbl...
> 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: Jon Skeet [C# MVP]: "Re: Problem with UNICODE"
- Previous message: Marina: "Re: When the connection to the database will be destroyed?"
- In reply to: BuddyHome: "Re: Late Binding in C#"
- Next in thread: BuddyHome: "Re: Late Binding in C#"
- Reply: BuddyHome: "Re: Late Binding in C#"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|