views:

64

answers:

1

.NET interop wraps COM objects into .NET objects (runtime-callable wrappers, RCWs), which hide the usual interface querying. In order to register a COM object representing a filter graph with the Running Objects Table, I need the (native) address of its IUnknown interface (see How can I reverse engineer a DirectShow graph?).

So the question is: How can I get a COM object's IUnknown pointer in C#?

+4  A: 

Use Marshal.GetIUnknownForObject().

Hans Passant
Thanks a lot! That's exactly what I was looking for!
Daniel Wolf