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. Enable/Disable Ribbon Menu Item Dynamically

Enable/Disable Ribbon Menu Item Dynamically

Scheduled Pinned Locked Moved C / C++ / MFC
java
4 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.
  • R Offline
    R Offline
    rajmohan 123
    wrote on last edited by
    #1

    Hi,java has

    J 1 Reply Last reply
    0
    • R rajmohan 123

      Hi,java has

      J Offline
      J Offline
      Jochen Arndt
      wrote on last edited by
      #2

      madhuresh sachan wrote:

      after this line cursor goes direct to the end of function,does not read below given code

      What does this mean? How did you know that the code is not read (executed would be a better word) if not using the debugger? Your code snippet contains no operation that changes any GUI element (enables/disables items) so that you would not 'see' anything. So run your program in the debugger and check what happens (e.g. by inspecting pRibbon, initial pos, lstItems.GetCount(), and the loop execution).

      R 1 Reply Last reply
      0
      • J Jochen Arndt

        madhuresh sachan wrote:

        after this line cursor goes direct to the end of function,does not read below given code

        What does this mean? How did you know that the code is not read (executed would be a better word) if not using the debugger? Your code snippet contains no operation that changes any GUI element (enables/disables items) so that you would not 'see' anything. So run your program in the debugger and check what happens (e.g. by inspecting pRibbon, initial pos, lstItems.GetCount(), and the loop execution).

        R Offline
        R Offline
        rajmohan 123
        wrote on last edited by
        #3

        Thanks for your reply pRibbon->GetItemIDsList(lstItems); In "lstItems" all the items of menu is coming, But the Main Problem is when I run this on debug mode,it is not executing the code after "pRibbon->GetItemIDsList(lstItems);" line of code.

        J 1 Reply Last reply
        0
        • R rajmohan 123

          Thanks for your reply pRibbon->GetItemIDsList(lstItems); In "lstItems" all the items of menu is coming, But the Main Problem is when I run this on debug mode,it is not executing the code after "pRibbon->GetItemIDsList(lstItems);" line of code.

          J Offline
          J Offline
          Jochen Arndt
          wrote on last edited by
          #4

          So when you set a breakpoint at the for loop after

          pos = lstItems.GetHeadPosition();

          that is not hit and execution is not stopped? That would be weird. I assume that you are using a debug build with all optimisations disabled. Otherwise, the compiler may optimise away the following lines because they effectively do nothing. To check this you can insert a TRACE statement inside the loop printing nElement.

          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