IE 9 failed to fire DISPID_ONQUIT event?
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: IE 9 failed to fire DISPID_ONQUIT event?

  1. #1
    Join Date
    Jan 2003
    Posts
    373

    IE 9 failed to fire DISPID_ONQUIT event

    The following code is for a toolbar to revceive DWebBrowserEvents2 events from Internet Explorer. Running on IE 8 and 7, the toolbar can catch both DISPID_DOCUMENTCOMPLETE and DISPID_ONQUIT events. On IE 9, the tooblar receives only DISPID_DOCUMENTCOMPLETE, the message box "Document load complete" will show when I open IE. But the toolbar can not receive DISPID_ONQUIT, the message box for "IE CLOSE event" never appears when I close IE 9, it looks like that IE 9 does not fire DISPID_ONQUIT event. Does IE 9 forget to fire this event? Thanks for any help!

    Code:
    STDMETHODIMP CMyIEToolBar::Invoke(DISPID dispidMember, REFIID riid, LCID lcid, WORD wFlags,   
                                    DISPPARAMS* pDispParams, VARIANT* pvarResult,   
                                    EXCEPINFO*  pExcepInfo,  UINT* puArgErr) 
    {
    		HRESULT		lResult = S_OK;
    
    		if (!pDispParams)
    			return E_INVALIDARG;
    
    		switch (dispidMember)
    		{
    
    		case DISPID_DOCUMENTCOMPLETE:   
                      MessageBox(NULL, _T("Document load complete"), _T("DOCUMENT COMPLETE"),MB_OK);   
                      break;   
    
    		case DISPID_ONQUIT:
    		//case DISPID_QUIT:
    		  MessageBox(NULL, _T("IE  CLOSE event"), _T("IE close"),MB_OK); 
    		  ManageConnection(Unadvise);
    		  break;   
    
    		default:
    		  break;
    
    		}
    		return lResult;
    }
    Last edited by forester; January 24th, 2013 at 08:41 AM.

  2. #2
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,020

    Re: IE 9 failed to fire DISPID_ONQUIT event

    Quote Originally Posted by forester View Post
    the toolbar can not receive DISPID_ONQUIT, the message box for "IE CLOSE event" never appears when I close IE 9, it looks like that IE 9 does not fire DISPID_ONQUIT event. Does IE 9 forget to fire this event?
    How do you know that? Did you try to debug? Did you try OutputDebugString instead of MessageBox? Or did you try to log your messages to text file?
    Best regards,
    Igor

  3. #3
    Join Date
    Jan 2003
    Posts
    373

    Re: IE 9 failed to fire DISPID_ONQUIT event?

    I didn't try OutputDebugString, I only tried MessageBox. When I close IE 9, the message box doesn't appear. I test it on IE 7 and 8, the message box shows as expected when IE is closed.

  4. #4
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,020

    Re: IE 9 failed to fire DISPID_ONQUIT event?

    Quote Originally Posted by forester View Post
    I test it on IE 7 and 8, the message box shows as expected when IE is closed.
    This means nothing. Using MessageBox is not so good when debugging such a tender thing like app total closure.
    Best regards,
    Igor

  5. #5
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,020

    Re: IE 9 failed to fire DISPID_ONQUIT event?

    Quote Originally Posted by hongphan1995vn View Post
    em m?i vĂ*o di?n dĂ*n, xin chĂ*o các anh ch? ?!!!
    Нет, я так не думаю.
    Best regards,
    Igor

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center