E
eduard.antonyan
All I'm doing is going through the webpage and analyzing the data,
here's the outline of the code:
in OnDocumentComplete(LPCTSTR lpszURL)
{
IDispatch *pDispatch = GetHtmlDocument();
IHTMLDocument2 *pDoc;
IHTMLElement *pBody;
BSTR str;
pDispatch->QueryInterface(IID_IHTMLDocument2,(void**)&pDoc);
pDispatch->Release();
pDoc->get_body((IHTMLElement **)&pBody);
pDoc->Release();
pBody->get_innerHTML(&str);
pBody->Release();
//---------------------------
// Analyze the str using wcsstr, Navigate2 depending on the results.
//---------------------------
SysFreeString(str);
CHtmlView::OnDocumentComplete(lpszURL);
}
The above results in a memory leak so what am I doing wrong?
I've tried calling CHtmlView::OnDocumentComplete(lpszURL) before I do
everything else and calling SysFreeString before doing Navigate2..
Can't think of anything else..
here's the outline of the code:
in OnDocumentComplete(LPCTSTR lpszURL)
{
IDispatch *pDispatch = GetHtmlDocument();
IHTMLDocument2 *pDoc;
IHTMLElement *pBody;
BSTR str;
pDispatch->QueryInterface(IID_IHTMLDocument2,(void**)&pDoc);
pDispatch->Release();
pDoc->get_body((IHTMLElement **)&pBody);
pDoc->Release();
pBody->get_innerHTML(&str);
pBody->Release();
//---------------------------
// Analyze the str using wcsstr, Navigate2 depending on the results.
//---------------------------
SysFreeString(str);
CHtmlView::OnDocumentComplete(lpszURL);
}
The above results in a memory leak so what am I doing wrong?
I've tried calling CHtmlView::OnDocumentComplete(lpszURL) before I do
everything else and calling SysFreeString before doing Navigate2..
Can't think of anything else..