How to get pointer to IUnknown in C#

让人想犯罪 __ 提交于 2020-01-22 18:52:13

问题


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


回答1:


Use Marshal.GetIUnknownForObject().



来源:https://stackoverflow.com/questions/3941349/how-to-get-pointer-to-iunknown-in-c-sharp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!