Exemplo n.º 1
0
void CWebBrowserUI::NavigateComplete2( IDispatch *pDisp,VARIANT *&url )
{
    CComPtr<IDispatch> spDoc;
    m_pWebBrowser2->get_Document(&spDoc);

    if (spDoc)
    {
        CComQIPtr<ICustomDoc, &IID_ICustomDoc> spCustomDoc(spDoc);
        if (spCustomDoc)
            spCustomDoc->SetUIHandler(this);
    }

    if (m_pWebBrowserEventHandler)
    {
        m_pWebBrowserEventHandler->NavigateComplete2(pDisp,url);
    }
}
Exemplo n.º 2
0
void CIECanvas::UpdateUIHandler() {
	CComPtr<IDispatch>		m_spDoc;

	if (m_spBrowser)
		m_spBrowser->get_Document(&m_spDoc);

    if (m_spDoc) {
		// make shure this really is a HTML document
		CComQIPtr<IHTMLDocument2, &IID_IHTMLDocument2> spHTML(m_spDoc);
		CComQIPtr<ICustomDoc, &IID_ICustomDoc> spCustomDoc(m_spDoc);

		if (spHTML && spCustomDoc) {
			spCustomDoc->SetUIHandler(m_pIE4Events);
			//printf("setting new UIHandler on document..\n");
		}
    }
}