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 » Assertion in extcontrolbar.cpp:19914 Collapse All
Subject Author Date
Scott Moore Jan 2, 2007 - 1:47 PM

I have a main window with a CExtControlBar that is the parent of a CExtWS< CDialog > derived class.


    class CMainFrame : public CExtNCW < CFrameWnd >, public CExtDynamicBarSite
    

    if ( !_recorderToolbar.Create(L"Capture", this, ID_VIEW_CAPTURE_BAR,
        WS_CHILD | CBRS_RIGHT | CBRS_GRIPPER | CBRS_FLYBY | CBRS_SIZE_DYNAMIC | CBRS_TOOLTIPS))
    {
        TRACE0("Failed to create capture control bar\n");
        return -1; // failed to create
    }

    if (!_recorderDlg.Create(RecorderDlg::IDD, &_recorderToolbar))
    {
        TRACE0("Failed to create capture dialog\n");
        return -1; // failed to create
    }


    
Everything works fine unless I click the pushpin on the control bar. When I click it, I get an assertion on this line:

    ASSERT( ((CExtDockBar*)pWndParent)->_GetCircleNo() > 0 );
    
If I click Ignore on the dialog, everything seems to work fine regardless. In addition, if I drag the control bar from being docked to floating then back to docked, the pushpin works fine and no longer asserts.

What is causing the assertion?

Thanks,
Scott

Scott Moore Jan 4, 2007 - 9:07 AM

Thansks, that fixed my ExtControlBar problem.

However, I tried switching my 2 CExtToolControlBar classes to use those methods and it asserts on !IsFixedSize(). So I switched back to CFrameWnd::DockControlBar() and it seems to work correctly. Is this correct or there another method I need to call to dock tool bars?

Thanks,
Scott

Suhai Gyorgy Jan 5, 2007 - 2:06 AM

You also need to call m_wndMyToolbar.EnableDocking( CBRS_ALIGN_ANY ); for all of your toolbars (and menubar and controlbars). Also, don’t forget to have this code in your CMainFrame::OnCreate before calling any of the CExtControlBar::DockControlBar*** methods:

	if( !CExtControlBar::FrameEnableDocking(this) ){
		ASSERT( FALSE );
		return -1;
	}

Sergiy Lavrynenko Jan 4, 2007 - 8:32 AM

Dear Scott,

Please use the CExtControlBar::DockControlBarInnerOuter() and CExtControlBar::DockControlBarLTRB() methods to specify the initial position of resizable control bars. The CExtControlBar::DockControlBar() method is left for compatibility with old Prof-UIS versions only. The CFrameWnd::DockControlBar() method should not be used with resizable control bars at all. After adjusting your code you may also need to clear the registry state data of your application to let the bars be docked correctly instead of loading previous state.