Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. OnUpdate(CCmdUI* pCmdUI) isnt called

OnUpdate(CCmdUI* pCmdUI) isnt called

Scheduled Pinned Locked Moved C / C++ / MFC
c++tutorialannouncement
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    John Oliver
    wrote on last edited by
    #1

    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

    M 1 Reply Last reply
    0
    • J John Oliver

      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

      M Offline
      M Offline
      Michael Dunn
      wrote on last edited by
      #2

      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

      J 1 Reply Last reply
      0
      • M Michael Dunn

        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

        J Offline
        J Offline
        John Oliver
        wrote on last edited by
        #3

        Thanks, 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

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups