8

.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#?

Community
  • 1
  • 1
Daniel Wolf
  • 12,855
  • 13
  • 54
  • 80

1 Answers1

13

Use Marshal.GetIUnknownForObject().

Simon P Stevens
  • 27,303
  • 5
  • 81
  • 107
Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536