Sinking Events via AfxConnectionAdvise

From: Tom (grmpf_at_wysin.de)
Date: 07/20/04

  • Next message: Brian Cryer: "Re: WebBrowser control and User Agent"
    Date: 20 Jul 2004 00:57:29 -0700
    
    

    Hello all.

    In my app I have an IE automation object, and a sink for some of its
    events. The following code shows this approach:

    IWebBrowser2 *pIE;
    CoCreateInstance(CLSID_InternetExplorer, NULL, CLSCTX_SERVER,
    IID_IWebBrowser2, (LPVOID *)&pIE);
    CIESink *pSink = new CIESink(this);
    IUnknown *pUnkSink = pSink->GetIDispatch(FALSE);
    AfxConnectionAdvise(pIE, DIID_DWebBrowserEvents2, pUnkSink, FALSE,
    &m_dwCookie);

    This works fine, at least on Win 2000 Systems. But now I have tried to
    run it on WinXP and here the IE crashes!!! It is loaded, but hangs
    right after the AfxConnectionAdvise()! THis is the case on all XP
    systems I have tested (3), without this line everything works. So has
    anyone an idea whats the point, I don't understand this difference to
    Windows 2000???

    Thanks for your help and best regards, Tom


  • Next message: Brian Cryer: "Re: WebBrowser control and User Agent"