Hi everyone !
I got hold of a valid IWebBrowser2 object.
I am passing it to a function that should return the value of href in a link tag in the IHTMLDocument3 object, here is the function:
Any ideas ?
Many Thanks
Andrea
I got hold of a valid IWebBrowser2 object.
I am passing it to a function that should return the value of href in a link tag in the IHTMLDocument3 object, here is the function:
Code:
LPCTSTR CInternetExplorer::GetHref(IWebBrowser2 *pWb) { CString empty(""); CComQIPtr<IHTMLDocument3> doc3 = (IHTMLDocument3*)pWb; if (doc3 == NULL) { return empty; } //CComQIPtr<IHTMLElementCollection> col; //CComPtr<IHTMLElementCollection> col; IHTMLElementCollection *col; //CComBSTR link("LINK"); USES_CONVERSION; BSTR link = A2BSTR("LINK"); HRESULT hr = doc3->getElementsByTagName(link, &col); // <-- At this line i get the Run-Time Check Failure #0... if (FAILED(hr)) return empty; /* some more code here left out for clarity */ return empty; }
Many Thanks
Andrea
Comment