Function/handler not working
-
I have the handlers and message maps as below. Whenever a child window is visible the following hanldler and its update function is not invoked. When the Child window is closed they are invoked.. Can anyone explain this behaviour. ON_COMMAND(ID_VIEW_DRAWTOOLBAR, OnDrawToolBar) ON_UPDATE_COMMAND_UI(ID_VIEW_DRAWTOOLBAR, OnUpdateDrawToolBar) void CMainFrame::OnDrawToolBar() { if (m_bUICtrlBar) { m_bUICtrlBar = false; ShowControlBar(&m_UICtrlsBar, m_bUICtrlBar, false ); } else { m_bUICtrlBar = true; ShowControlBar(&m_UICtrlsBar, m_bUICtrlBar, false ); } } void CMainFrame::OnUpdateDrawToolBar(CCmdUI *pCmdUI) { if (m_UICtrlsBar.IsVisible()) m_bUICtrlBar = TRUE; else m_bUICtrlBar = FALSE; if (m_bUICtrlBar) { pCmdUI->SetCheck(TRUE); //AfxMessageBox("visible so check"); } else { pCmdUI->SetCheck(FALSE); //AfxMessageBox("Invisible so Uncheck"); } } laiju