OnUpdate(CCmdUI* pCmdUI) isnt called
-
Hello I have two CDialog based classes, both with toolbars, using the technique used in the MSDN MFC sample dlgcbr32 which describes how to use toolbars and status bars in dialogs by overriding these particular control classes I created the first class a few years ago and it works. I cannot get the toolbar button states to update in the 2nd class which I recently created, although the class is similar to the first. I cannot get OnUpdateButtonX(CCmdUI* pCmdUI) to be called - CDlgToolBar::OnIdleUpdateCmdUI isn't being called. Can anybody tell me what methods or messages need to be present for OnIdleUpdateCmdUI to get called. Thanks, John
-
Hello I have two CDialog based classes, both with toolbars, using the technique used in the MSDN MFC sample dlgcbr32 which describes how to use toolbars and status bars in dialogs by overriding these particular control classes I created the first class a few years ago and it works. I cannot get the toolbar button states to update in the 2nd class which I recently created, although the class is similar to the first. I cannot get OnUpdateButtonX(CCmdUI* pCmdUI) to be called - CDlgToolBar::OnIdleUpdateCmdUI isn't being called. Can anybody tell me what methods or messages need to be present for OnIdleUpdateCmdUI to get called. Thanks, John
Handle the WM_KICKIDLE message (#include "afxpriv.h" to get the definition) and call
UpdateDialogControls(this, FALSE);
--Mike-- Just released - RightClick-Encrypt - Adds fast & easy file encryption to Explorer My really out-of-date homepage Sonork-100.19012 Acid_Helm -
Handle the WM_KICKIDLE message (#include "afxpriv.h" to get the definition) and call
UpdateDialogControls(this, FALSE);
--Mike-- Just released - RightClick-Encrypt - Adds fast & easy file encryption to Explorer My really out-of-date homepage Sonork-100.19012 Acid_HelmThanks, I've tried it but no luck. The OnKickIdle method isn't called. I'll keep trying but in case anybody has spare time here's a checklist of what's going on: -Toolbar has same resource ID as menu. The buttons have same IDs as menu items. Menu items are updated Okay but toolbar isn't -Class has CDlgTool member, which is derived from CToolbar and has OnIdleUpdateCmdUI method, which isn't called -Dlg shown non-modally m_calcDlg=new CCalcDlg(this); m_calcDlg->Setup(m_report,m_UBuckling); m_calcDlg->Create(); m_calcDlg->ShowWindow(SW_SHOWNORMAL); After this I swear I'll never write a CDialog based app. ever again! bye, John