I have a COM interface defined like this
interface Client : IUnknown
{
[id(1)] HRESULT GetSomething
(
enum SomeID someID,
[out] IUnknown **pUnknown
);
};
How can I pass IUnknown
object using C#?
You don't pass anything, it returns an interface pointer. An opaque one, IUnknown is implemented by all COM interfaces. In C# it will be an object of type object, the managed version of "could be anything". So basic code looks like this:
object retval;
client.GetSomething(SomeID.Magic, out retval);
And then it is up to you to cast the returned object into the actual interface type, probably based on Magic. Your question gives no hint at all what it might be, you'll have to read the documentation of the COM component to have an idea.