views:

304

answers:

1

I have the following in my IE extension to handle when a tab is switched in IE, etc. [ATL project, VS2008, C++ using IDispEventImpl]

SINK_ENTRY_EX(1, DIID_DWebBrowserEvents2, DISPID_WINDOWSTATECHANGED,WindowStateChanged)
.
.
.    
void WindowStateChanged (DWORD dwFlags, DWORD dwValidFlagsMask);
.
.
.
.
void CHelloWorld::WindowStateChanged (DWORD dwFlags, DWORD dwValidFlagsMask){
    //I don't do anything here right now. Even if I have some piece of code like
    //ATLTRACE, IE just hangs

}

Whenever I run my code, the IE stops working (I get a dialog "Internet Explorer has stopped working") What am I doing wrong? What might be missing in my code? Or, Is this a bug in IE8? I'm working on Windows 7 (eval) BTW.

A: 

How stupid of me. I missed this: STDMETHODCALLTYPE So my code is:

SINK_ENTRY_EX(1, DIID_DWebBrowserEvents2, DISPID_WINDOWSTATECHANGED,WindowStateChanged)
.
.
.    
void STDMETHODCALLTYPE WindowStateChanged (DWORD dwFlags, DWORD dwValidFlagsMask);
.
.
.
.
void STDMETHODCALLTYPE CHelloWorld::WindowStateChanged (DWORD dwFlags, DWORD dwValidFlagsMask){
    //I don't do anything here right now. Even if I have some piece of code like
    //ATLTRACE, IE just hangs

}

Now, IE hangs no more. :)

GotAmye