S
Scott Holman
Framework 1.1
I've have com interop reference that has a method that returns IUnknown.
How do I cast the IUnknown reference to the specific interface.
I've tried the code below but the call to myInteropRef.Foo() raises a
NullReferenceException. What am I doing wrong?
//instantiate com object
MyInteropRefClass myInteropRef = new MyInteropRefClass();
System.Object fooObj = myInteropRef.Foo();
IMyInterface myIntf = (IMyInterface) fooObj;
Thanks
I've have com interop reference that has a method that returns IUnknown.
How do I cast the IUnknown reference to the specific interface.
I've tried the code below but the call to myInteropRef.Foo() raises a
NullReferenceException. What am I doing wrong?
//instantiate com object
MyInteropRefClass myInteropRef = new MyInteropRefClass();
System.Object fooObj = myInteropRef.Foo();
IMyInterface myIntf = (IMyInterface) fooObj;
Thanks