Ms WebBrowser GetSource!
-
hi i have inserter ms web browser acticeX in my project. mr.Sargoytchev told me that if i want to get the source code of the html that is showing by this activeX u should do the following steps:
1. Use the IWebBrowser2::Document property to obtain an IDispatch interface to the DOM document. 2. Query the obtained IDispatch for IHTMLDocument3. 3. Use the IHTMLDocument3::createTextNode() method to convert the root node to text.
first how can i get IWebBrowser2 pointer for my ActiveX window. for example my activeX class is CExplorer1. and my variable is :CExplorer * web1;
here is my code for step one (Correct me if i'm wroing):IWebBrowser2* pWebBrowser; //this in null and must point to my activeX window i dunno how! IDispatch* pHtmlDoc = NULL; HRESULT hr = pWebBrowser->get_Document( &pHtmlDoc );
but i cant write the code to Query the obtained IDispatch for IHTMLDocument3. :( any idea ? thanx.