A
A Wieser
I'm trying to create a browser control in edit mode with VS 2005 using C++.
I've added the WebBrowser Control to my form as webBrowser1.
However, I can't seem to get to an IHTMLDocument2 so that I can switch
designMode on.
I try this, but get an exception.
mshtml::IHTMLDocument2 ^doc;
Object ^boxDoc = this->webBrowser1->Document;
doc = (mshtml::IHTMLDocument2 ^)boxDoc; // exception thrown here!
doc->designMode = "On";
An unhandled exception of type 'System.InvalidCastException' occurred in
testforms.exe
Additional information: Unable to cast object of type
'System.Windows.Forms.HtmlDocument' to type 'mshtml.IHTMLDocument2'.
Any suggestions on how to do this?
Tony
I've added the WebBrowser Control to my form as webBrowser1.
However, I can't seem to get to an IHTMLDocument2 so that I can switch
designMode on.
I try this, but get an exception.
mshtml::IHTMLDocument2 ^doc;
Object ^boxDoc = this->webBrowser1->Document;
doc = (mshtml::IHTMLDocument2 ^)boxDoc; // exception thrown here!
doc->designMode = "On";
An unhandled exception of type 'System.InvalidCastException' occurred in
testforms.exe
Additional information: Unable to cast object of type
'System.Windows.Forms.HtmlDocument' to type 'mshtml.IHTMLDocument2'.
Any suggestions on how to do this?
Tony