Hello!
I just added CExtToolControlBar to my app, here’s initialization:
VERIFY(
g_CmdManager->ProfileSetup(
theApp.m_pszProfileName,
GetSafeHwnd() // HWND of the frame window
)
);
VERIFY(
g_CmdManager->UpdateFromToolBar(
theApp.m_pszProfileName,
IDR_MAINFRAME
)
);
VERIFY(
g_CmdManager->UpdateFromMenu(
theApp.m_pszProfileName,
IDR_MAINFRAME)
);
VERIFY(
g_CmdManager->UpdateFromMenu(
theApp.m_pszProfileName,
IDR_ProfitRangerTYPE)
);
if( !m_wndToolBar.Create(
_T( "Toolbar name" ),
this,
AFX_IDW_TOOLBAR
)
|| !m_wndToolBar.LoadToolBar( IDR_MAINFRAME )
)
{
TRACE0( "Failed to create toolbar" );
return -1;
}
Toolbar is displayed, but when I press a button, nothing happens (menu works like a charm).
What is wrong?
2. I added these lines of code to allow docking:
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndToolBar);
But DockContolBar fails on winfrm2.cpp, line 92:
==
pDockBar = (CDockBar*)GetControlBar(dwDockBarMap[i][0]);
ASSERT(pDockBar != NULL);
==
Please, help