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 » Dockable CExtControlBar being lost the entire application gets refreshed. Collapse All
Subject Author Date
Debabrata Mukherjee Oct 7, 2007 - 10:04 PM

I have a dockable control bar which is docked with a main CExtTabPageContainerWnd. Now when I open another OCX is loaded onto my main application, the entire application gets refreshed. It is now that the dockable control bar gets vanished because the docking code had been written in the oncreate() method and this is called only once during the startup of the application. Could you please let us know what could be the reasons?

Debabrata Mukherjee Oct 24, 2007 - 11:45 PM

I have a Mainframe for my main app called saisd. I have a dockable control bar called "binsbar" that is created inside the OnCreate() of MainFrame. Inside the Mainframe I have CExtTabPageContainerWnd called the ChildView. This child view class has three tab pages.
CSaISMainFrame::OnCreate()
{
//Creation of TabPage ContinerWnd in the OnCreateClient method here.
if( CExtNCW < CFrameWnd > :: OnCreate( lpCreateStruct ) == -1 )
return -1;
//Following is the code for creation of binsbar

m_wndBinsBar.SetInitDesiredSizeVertical(CSize(200,50));
    CString strFrameName = _T("");
    strFrameName.LoadString(IDS_SAIS_BIN_EXPLORER);
if( !m_wndBinsBar.Create(strFrameName,this,AFX_WS_DEFAULT_VIEW/*,AFX_IDW_PANE_FIRST*/))
    {
        TRACE0(_T("Failed to create m_wndBinsBar\n"));
        return -1; // fail to create
    }

CCreateContext* pContext = NULL;
if (lpCreateStruct != NULL)
        pContext = (CCreateContext*)lpCreateStruct->lpCreateParams;

if( ! m_pBinsView->Create(NULL,_T(""),WS_CHILD | WS_VISIBLE,CRect(200,50,1,1),
        &m_wndBinsBar,ID_SAIS_BINSVIEW,pContext))
{
        ASSERT( FALSE );
        return -1;
}
CRect crAlreadyDockBinBarforFormat;
m_wndDataToolsBar.GetWindowRect( &crAlreadyDockBinBarforFormat );
crAlreadyDockedBar.OffsetRect( 1, 0 );
DockControlBar(&m_wndFormattingBar,AFX_IDW_DOCKBAR_TOP,&crAlreadyDockBinBarforFormat);
RecalcLayout();
//UI Enhancements 6.5

    CExtControlBar::g_bAllowDynamicTabsOleDropTarget = true;
m_wndBinsBar.EnableDocking( CBRS_ALIGN_ANY );
    if( !m_wndBinsBar.DockControlBarInnerOuter(AFX_IDW_DOCKBAR_LEFT,false,NULL,1))
    {
        ASSERT( FALSE );
        return -1;
    }
    if( ! CExtControlBar::FrameEnableDocking(this) )
    {
        ASSERT( FALSE );
        return -1;
    }
// #if (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
    if( ! CExtControlBar::FrameInjectAutoHideAreas(this) )
    {
        ASSERT( FALSE );
        return -1;
    }
//#endif // (!defined __EXT_MFC_NO_TAB_CONTROLBARS)

    if( ! CExtControlBar::ProfileBarStateLoad(
            this,
            /*pApp->m_pszRegistryKey,
            pApp->m_pszProfileName,*/
            _T("SAISD"),_T("DESIGN STUDIO"),
            pApp->m_pszProfileName,
            &m_dataFrameWP
            )
        )
    {
        //DockControlBar( &m_wndMenuBar );
        DockControlBar( &m_wndBinsBar, AFX_IDW_DOCKBAR_LEFT );
    }

}

At runtime when I drag a so called "transform", the new toolbars and menubars in the mainframe are loaded. Also these transforms have a new mainframe of theirs. So when they get loaded the docked bins bar vanishes as of course it was created and docked with the original mainframe of the application not the one that we loaded just now. However if I have done an auto hide, then I can see the binsbar at the side. Please let me know if I can dock my controlbar at the available mainframe rather than the one which was originally created.

Please treat it with utmost urgency.!

Debabrata Mukherjee Oct 12, 2007 - 5:23 AM

A mail was sent yesterday with screenshots but we have not recieved any updates yet

Technical Support Oct 8, 2007 - 2:05 PM

This re-painting effect can be caused by the ActiveX control. The easiest way to solve such a problem is to create your ActiveX control as a child of its invisible parent window and then show the parent window.