Iunknown in c#

  • Thread starter Thread starter s.k
  • Start date Start date
S

s.k

Hello group.
I need to use some COM components in C#.
One of the components has a function that receives an argument which
is an IUnknown for a different com object.
In C++ it is implemented as:
ComObject1->function(GetIUnknownForObject(ComObject2));
How do I implment this call in c#?
Help would be appreciated.

Thakns

S.K
 
s.k,

When you import the interface into .NET for the function, it should be
declared as object. Also, it should have a MarshalAs attribute attached to
the parameter with a Value of UnmanagedType.IUnknown.

Hope this helps.
 
Back
Top