Hi. Don't know if this is the forum for COM related questions, but it still is Windows programming. I Tried to get the IHTMLWindow2 interface of an IHTMLDocument2 using get_parentWindow(), but the function crashed my application.
Code:
IHTMLWindow2 *parentWindow = NULL;
//webBrowser is a valid IWebBrwoser2 obejct
webBrowser->get_Document(&iDispatchDocument);
iDispatchDocument->QueryInterface(IID_IHTMLDocument2, (void**)&htmlDocument);
htmlDocument->get_parentWindow(&parentWindow);
I am sure that htmlDocument is a valid pointer, since I can call its other functions (I can even get all the elements).
What could be the cause for this crash? Thank you for any help.