Where can I find the list of interfaces supported by the WPF WebBrowser.Document from C#?

前提是你 提交于 2019-12-13 11:23:47

问题


Where can I find the list of interfaces supported by the WPF WebBrowser.Document (namespace system.windows.controls) from C#?

Moreover, where can I find the official documentation from Microsoft web site? The document from MS http://msdn.microsoft.com/en-us/library/system.windows.controls.webbrowser.document%28v=vs.110%29.aspx only state this:

Remarks

The Document object needs to be cast to the COM interface you are expecting.

But I cannot find the list of interfaces that I can expect from this object.


回答1:


You can include an reference to Microsoft.mshtml to your project.

Then you can use the mshtml namespace with the interfaces IHTMLDocument, IHTMLDocument or IHTMLDocument[2...5]. Dont know why there are so many.

They all are implemented by the HTMLDocumentClass. You can get additional info here.




回答2:


You can try invoking wb.Document.GetType().GUID on the .NET RCW object and see if it's of an expected COM coclass. You can also try wb.Document.GetType().GetInterfaces().

This might work for HTML, Office and any other component with a type library, but it might not work for objects that don't provide type information, such as C++ components that are not implemented on top of a type library, i.e. they use pre-compiled standard marshaling instead.



来源:https://stackoverflow.com/questions/27833944/where-can-i-find-the-list-of-interfaces-supported-by-the-wpf-webbrowser-document

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