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. ON_UPDATE_COMMAND_UI and CDialog's

ON_UPDATE_COMMAND_UI and CDialog's

Scheduled Pinned Locked Moved C / C++ / MFC
c++algorithmshelptutorialquestion
4 Posts 3 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.
  • S Offline
    S Offline
    Sprudling
    wrote on last edited by
    #1

    I have an MFC dialog based app, and ON_UPDATE_COMMAND_UI just doesn't work. For some reason ON_UPDATE_COMMAND_UI is sent when I actually choose the menu-option (Rather when the menu drops down). After asking around and searching the net it seems like this is a known problem, but I haven't been able to find any good info on why and/or how to make it work. Is there someone here who can? Sprudling ;)

    U E 2 Replies Last reply
    0
    • S Sprudling

      I have an MFC dialog based app, and ON_UPDATE_COMMAND_UI just doesn't work. For some reason ON_UPDATE_COMMAND_UI is sent when I actually choose the menu-option (Rather when the menu drops down). After asking around and searching the net it seems like this is a known problem, but I haven't been able to find any good info on why and/or how to make it work. Is there someone here who can? Sprudling ;)

      U Offline
      U Offline
      udayGovekar
      wrote on last edited by
      #2

      Hi, For your first question, Suppose at run time you want to change(enable/disable,show/hide) the menuitems, then this function is usefull. Second, It works quite similar to other functions. You just have to add this function and write ur logic.

      1 Reply Last reply
      0
      • S Sprudling

        I have an MFC dialog based app, and ON_UPDATE_COMMAND_UI just doesn't work. For some reason ON_UPDATE_COMMAND_UI is sent when I actually choose the menu-option (Rather when the menu drops down). After asking around and searching the net it seems like this is a known problem, but I haven't been able to find any good info on why and/or how to make it work. Is there someone here who can? Sprudling ;)

        E Offline
        E Offline
        Ernest Laurentin
        wrote on last edited by
        #3

        One way to do this is to loop through all items once the popup menu is drop down and call CCmdUI::DoUpdate for all the child sub-menu. You will have to catch WM_MENUSELECT and loop through the sub-menu. Good luck! Last Article: Client/Server Socket class

        S 1 Reply Last reply
        0
        • E Ernest Laurentin

          One way to do this is to loop through all items once the popup menu is drop down and call CCmdUI::DoUpdate for all the child sub-menu. You will have to catch WM_MENUSELECT and loop through the sub-menu. Good luck! Last Article: Client/Server Socket class

          S Offline
          S Offline
          Sprudling
          wrote on last edited by
          #4

          Thank you VERY much :rose: This actually solves it quite elegant :suss: I like that :-D Sprudling :wtf: :-O

          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