Dear Support team,
We have encountered problems in using the docked control bars. We have compiled a project in http://210.245.233.38/download/OCXTest_dock.zip.
To begin with, please perform the following steps.
Step 1: Extract the folder
Step 2: regsvr32 ocxtest_dock.ocx
Step 3: Open index.html
in a browser and the following screen should be shown:
Then we can reproduce the 2 strange behaviours.
1) when the lower test2 control bar (CExtDynamicControlBar
) is unpinned, it changes to auto-hidden mode. Naturally, it should be hidden and the test1 will extend to the bottom to replace the area test2 occupied. However, there is leftover in the old area and test1’s control bar cannot extend to that area. Also, if we try to drag on that area, the process will be crashed.
2) After we unpin both control bars, we cannot click these bars again. It has simply no effect when they are clicked.
In coding, we are using all the standard methods, below is the code snippet of CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
. For more details, please see the zip files, it has all the files the project needed.
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct){ if( AFrameWnd :: OnCreate( lpCreateStruct ) == -1 ) return -1; CWinApp * pApp = ::AfxGetApp(); // pApp->m_pszRegistryKey = _T("PongTest"); ASSERT( pApp != NULL ); ASSERT( pApp->m_pszRegistryKey != NULL ); ASSERT( pApp->m_pszRegistryKey[0] != _T(’\0’) );ASSERT( pApp->m_pszProfileName != NULL );ASSERT( pApp->m_pszProfileName[0] != _T(’\0’) ); VERIFY( g_CmdManager->ProfileSetup( pApp->m_pszProfileName, GetSafeHwnd())); ///////////////////////////////////////////////////////////////////////// if( !CExtControlBar::FrameEnableDocking(this)){ ASSERT( FALSE ); return -1; } if( !CExtControlBar::FrameInjectAutoHideAreas(this) ){ ASSERT( FALSE ); return -1; } // Install dynamic bar site for this frame window CExtDynamicBarSite::m_nBarListInMenusCmdID = ID_DYNAMIC_BARS_LIST; CExtDynamicBarSite::Install( this ); HINSTANCE hInst = ::AfxGetInstanceHandle(); HICON hIcon; hIcon = (HICON)::LoadImage(hInst, MAKEINTRESOURCE(IDI_NEWDOC), IMAGE_ICON, 16, 16, 0 ); if (hIcon) m_CmdIconNewDoc.AssignFromHICON( hIcon, TRUE); m_CmdIconTest.AssignFromHICON(hIcon, true); m_hcb1.Create(_T("test1"), this, ID_VIEW_RESIZABLE_BAR_1); m_hcb2.Create(_T("test2"), this, ID_VIEW_RESIZABLE_BAR_2); m_hcb1.EnableDocking(CBRS_ALIGN_ANY); m_hcb2.EnableDocking(CBRS_ALIGN_ANY); m_hcb1.DockControlBarInnerOuter( AFX_IDW_DOCKBAR_LEFT, true, this, false ); m_hcb2.DockControlBarLTRB(50, &m_hcb1, AFX_IDW_DOCKBAR_BOTTOM, 1); RecalcLayout(); return 0; }
Please advise and help. Thanks.
Regards,
Chun Pong