All the control bars inside the frame window must have unique identifiers. This is related both to MFC and Prof-UIS control bars. You should add the main frame message map entries for each control bar. Here is the example of how it looks like in the DRAWCLI sample application:
ON_COMMAND_EX(ID_VIEW_TOOLBAR2, OnBarCheck )
ON_UPDATE_COMMAND_UI(ID_VIEW_TOOLBAR2, OnUpdateControlBarMenu)
ON_COMMAND_EX(ID_VIEW_PALETTE, OnBarCheck )
ON_UPDATE_COMMAND_UI(ID_VIEW_PALETTE, OnUpdateControlBarMenu)
ON_COMMAND_EX(ID_VIEW_UI_LOOK_BAR, OnBarCheck )
ON_UPDATE_COMMAND_UI(ID_VIEW_UI_LOOK_BAR, OnUpdateControlBarMenu)
The
OnBarCheck()
and
OnUpdateControlBarMenu()
methods are provided by the MFC’s
CFrameWnd
class. The work well with Prof-UIS toolbar, menu bar, panel bars and resizable control bars without auto-hiding feature enabled. If you are using resizable control bars with auto-hiding feature, then you should re-define the
OnBarCheck()
and
OnUpdateControlBarMenu()
methods in your main frame class:
void CMainFrame::OnUpdateControlBarMenu( CCmdUI * pCmdUI )
{
CExtControlBar::DoFrameBarCheckUpdate( this, pCmdUI, false );
}
BOOL CMainFrame::OnBarCheck( UINT nID )
{
Return CExtControlBar::DoFrameBarCheckCmd( this, nID, false );
}