S
Scott English
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.
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.