Hi Tim,
I understand your scenario, if you look at the HTMLDocument class, it did
not include a ctor or a method to create a HTMLDocument based on a
IHTMLDocument interface. Actually this is somewhat a kind of .NET wrap.
If we look into the HTMLDocument class in MSDN, we will get the definition
as below.
Note: This class is new in the .NET Framework version 2.0.
Provides top-level programmatic access to an HTML document hosted by the
WebBrowser control.
As you said, the unmanaged HTMLDocument interface did not include a
reference to a managed HTMLDocument class.
So according to the document, the HTMLDocument class is used to help to
access to an HTML document hosted by the WebBrowser control. That is why it
did not have a ctor to create a HTMLDocument.
Also from your description below
"It would be nice to be able to use the DOM in System.Windows.Forms with
the
control. You can easily get the unmanaged DomDocument from a managed
HtmlDocument. Does anyone know a way to do the opposite?"
So I understand that you already have a unmanaged DomDocument, and you want
to get its managed reference. As you said in the previous post,
Marshal.GetTypedObjectForIUnknown will get a wrapper generated by MSHTML
COM TypeLib which is provided by MS. I just wonder why you did not want use
the wrapper. If you do not want to use MSHTML library in .NET, I think you
have to build one HTML .NET wrapper yourself. This should be complex job,
if you do wanna do that, I suggest you contact MSPSS directly.
http://support.microsoft.com
If I have any misunderstanding or you have any concern, please feel free to
post here.
Best regards,
Peter Huang
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.