G
Guest
All,
I am trying to access a complex COM library with nested COM classes. In
order to get at a certain class you must call a method on class A and this
method will return a instance of COM class B. FOr instance the VB code looks
like this:
Public Function GetFee(sFeeCode As String) As Test.FeeCls
....
End Function
I've written code to access the method GetFee in Class A, but the object
returned from the InvokeMember is undefined. No exceptions are generated but
the COM class B is not instantiated. Here is the "late Bound" code:
object[] args = new object[1];
args[0] = "";
tyClsB = Type.GetTypeFromProgID("Test.FeeCls",true);
oClsB = tyClsA.InvokeMember("GetFee", BindingFlags.InvokeMethod, null,
oClsA, args, null, null, null);
The variable oClsB is not valid.
if I use the interop lib generated and write this code it works:
string strFeeTy = "a03";
Test.FeeCls clsB;
clsB = clsA.GetFee(ref strFeeTy);
Any help or tips would be appreciated...
Stan
I am trying to access a complex COM library with nested COM classes. In
order to get at a certain class you must call a method on class A and this
method will return a instance of COM class B. FOr instance the VB code looks
like this:
Public Function GetFee(sFeeCode As String) As Test.FeeCls
....
End Function
I've written code to access the method GetFee in Class A, but the object
returned from the InvokeMember is undefined. No exceptions are generated but
the COM class B is not instantiated. Here is the "late Bound" code:
object[] args = new object[1];
args[0] = "";
tyClsB = Type.GetTypeFromProgID("Test.FeeCls",true);
oClsB = tyClsA.InvokeMember("GetFee", BindingFlags.InvokeMethod, null,
oClsA, args, null, null, null);
The variable oClsB is not valid.
if I use the interop lib generated and write this code it works:
string strFeeTy = "a03";
Test.FeeCls clsB;
clsB = clsA.GetFee(ref strFeeTy);
Any help or tips would be appreciated...
Stan