Vijay wrote:
Hi All,
In the original code of mfcembed, I have changed this method -
void CMfcEmbedApp::OnNewBrowser()
{
CBrowserFrame *pBrowserFrame = CreateNewBrowserFrame();
//Load the HomePage into the browser view
//if(pBrowserFrame && (GetStartupPageMode() == 1))
//pBrowserFrame->m_wndBrowserView.LoadHomePage();
if(pBrowserFrame) {
pBrowserFrame->m_wndBrowserView.OpenURL("http://www.google.co.in");
//Sleep here for sometime to wait for document to load
nsCOMPtr<nsIDOMDocument> doc;
pBrowserFrame->GetBrowserImpl()->GetDOM(doc);
nsIDOMNode* mEndParent = (nsIDOMNode*)doc;
nsCOMPtr<nsIDOMNodeList> children;
nsresult nres =
mEndParent->GetChildNodes(getter_AddRefs(children));
}
}
In the last line, the exe crashes stating Access Code Violation.
Please tell what's wrong with this code?
Many thanks,
Vijay
Can you verify that this line:
pBrowserFrame->GetBrowserImpl()->GetDOM(doc);
is actually getting the nsIDOMDocument? Also, if you are successfully
getting the nsIDOMDocument, can you verify this this line:
nsIDOMNode* mEndParent = (nsIDOMNode*)doc;
is also getting something and not just failing?
Niky Williams
_______________________________________________
mozilla-embedding mailing list
[email protected]
http://mail.mozilla.org/listinfo/mozilla-embedding