Re: Late Binding in C#

From: BuddyHome (Buddy_at_onlinehome.com)
Date: 04/02/04


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.
>
>



Relevant Pages

  • Re: Late Binding in C#
    ... Am I missing something? ... Check out Invoke in MSDN. ... >> I am writing an C# program. ... includes calling the COM object's IDispatch interface. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: When is Invoke() Really Required?
    ... then it is safe to call that method. ... in the context of the calling thread, now if the calling thread does not ... > Invoke, BeginInvoke, EndInvoke and CreateGraphics. ... Does this apply for absolutely every method or property in a control ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • Re: INVOKE (English vs COBOL
    ... William M. Klein wrote: ... >still hoping for a '97 Standard), I wrote a number of papers on WHY I thought ... Calling a method is like calling a ... The term Invoke a Method is also used. ...
    (comp.lang.cobol)
  • syslog_r writes to /dev/null
    ... I was debugging a problem with a program recently which appeared to ... be writing data to the wrong file descriptor, ... writing my syslog messages to /dev/null as well as to the syslog ... Calling openlog_r ...
    (comp.unix.aix)
  • Re: Becoming a C _developer_
    ... > of Win32 API code. ... Knowing C is a bit like knowing how to use a pen, ... Underneath they are calling the same code, ... > begin writing a useful application that I can proudly boast of. ...
    (comp.lang.c)