Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » Docking DynamicControlBar + MessageBox Collapse All
Subject Author Date
Suhai Gyorgy Mar 10, 2006 - 7:47 AM

Dear Support,

My app has some DynamicControlBars and handles a timer with OnTimer(), as well. I get an Assertion, when during docking any of my DynamicControlBars, OnTimer tries to pop up a messagebox with AfxMessageBox(). In Call Stack I can see it comes from CMiniDockFrameWnd::WindowProc. It doesn’t happen every time, but I couldn’t find out yet in which state of the docking mechanism it happens and in which it doesn’t.

Thank you:
Chris

Technical Support Mar 11, 2006 - 9:53 AM

We think you need to handle several situations before displaying message boxes with OnTimer().

1) Cancel any tracking of pop-up menus.

    if( CExtPopupMenuWnd::IsMenuTracking() )
        CExtPopupMenuWnd::CancelMenuTracking();
2) Cancel any tooltips.
    CWnd::CancelToolTips();
    CExtPopupMenuSite::g_DefPopupMenuSite.GetTip().Hide();
If you use independent copies of the CExtPopupMenuTipWnd window, invoke their Hide() method.

If you use independent copies of the CToolTipCtrl windows, their DestroyWindow() method or send WM_CANCELMODE to them.

3) Cancel the drag-and-drop of the control bar.
    CExtControlBar * pBar = CExtControlBar::_DraggingGetBar();
    if( pBar->GetSafeHwnd() != NULL )
        pBar->SendMessage( WM_CANCELMODE );
4) Send the WM_CANCELMODE message to your main window or to the current popup modal window. This can be used to cancel classic Windows menus and shell menus if they are used in your application.

5) Analyze whether any other on timer message box or modal window is currently active and prevent multiple copies of such windows. This is specific to your project.