I have MFC dialog based application hosting IE control.
It successfuly displays any URL i want.
I'm trying to read html opened in IE control. I know there are few ways to do it - I've read exisitng posts and implemented solution using IPersistFile. It doesn't work.
Here's microsoft example for it :
Here's my code :
PATCH pDispatch, VARIANT FAR* URL)
HRESULT hr = E_FAIL;
IDispatch* pDisp = NULL;
IHTMLDocument2* pDoc = NULL;
pDisp = m_browser.GetDocument();
//pDisp = pDispatch;
if(SUCCEEDED(hr = pDisp->QueryInterface(IID_
IPersistFile* pFile = NULL;
LPCOLESTR file = L"c:\\test1.htm";
1) in debug mode i see that (LPDISPATCH pDispatch) which i get as parameter is different from
pDisp = m_browser.GetDocument();. Why is that ?
2) If i use LPDISPATCH pDispatch which i get as parameter , firts query fails.
If i use pDisp = m_browser.GetDocument() (as shown in MS example) ,
firts query succeded , but second query fails. In debug mode i can see that pDoc equals to pDisp and that pFile is 0x000000 as it should be.
Any ideas why second query fails ?