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. toolbars retain old settings

toolbars retain old settings

Scheduled Pinned Locked Moved C / C++ / MFC
c++windows-adminquestion
6 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
    rayjoslyn
    wrote on last edited by
    #1

    I have an MFC program using CMFCToolBars. The toolbar settings are getting saved and read from the registry fine. However when I make changes to the toolbar, re-compile and run the program, it doesn't see these new changes unless I go into the registry and delete the HKEY_CURRENT_USER\Software\MyProgram\settings key. What should I be doing to keep this from happening? Thanks Ray

    S 1 Reply Last reply
    0
    • R rayjoslyn

      I have an MFC program using CMFCToolBars. The toolbar settings are getting saved and read from the registry fine. However when I make changes to the toolbar, re-compile and run the program, it doesn't see these new changes unless I go into the registry and delete the HKEY_CURRENT_USER\Software\MyProgram\settings key. What should I be doing to keep this from happening? Thanks Ray

      S Offline
      S Offline
      sashoalm
      wrote on last edited by
      #2

      I'm not sure what you mean by 'changes in the toolbar' (is it the layout you mean?), but what likely is happening is that when you make changes in your code, you change only the *default* layout. Your program first initializes the layout as your code specifies (the default layout), and then looks for user-customized layout. Since one is available, it *overrides* the changes you have made to your code. Again (if this is what I'm thinking it is), your code only sets the initial, default layout. If there is user-customized layout it supersedes it. I think this is how it's supposed to work.

      There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal

      R 1 Reply Last reply
      0
      • S sashoalm

        I'm not sure what you mean by 'changes in the toolbar' (is it the layout you mean?), but what likely is happening is that when you make changes in your code, you change only the *default* layout. Your program first initializes the layout as your code specifies (the default layout), and then looks for user-customized layout. Since one is available, it *overrides* the changes you have made to your code. Again (if this is what I'm thinking it is), your code only sets the initial, default layout. If there is user-customized layout it supersedes it. I think this is how it's supposed to work.

        There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal

        R Offline
        R Offline
        rayjoslyn
        wrote on last edited by
        #3

        By changes, I mean say if I add a button to a toolbar it doesn't show up unless I delete these setting in the registry. So where or how do I keep it from loading the customized layout if I make changes to my toolbar?

        S 1 Reply Last reply
        0
        • R rayjoslyn

          By changes, I mean say if I add a button to a toolbar it doesn't show up unless I delete these setting in the registry. So where or how do I keep it from loading the customized layout if I make changes to my toolbar?

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

          What type of toolbar are you using? I mean the name of the class. Standard MFC toolbar, or some customized class?

          There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal

          R 1 Reply Last reply
          0
          • S sashoalm

            What type of toolbar are you using? I mean the name of the class. Standard MFC toolbar, or some customized class?

            There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal

            R Offline
            R Offline
            rayjoslyn
            wrote on last edited by
            #5

            It is my class with a base class of CMFCToolBar

            S 1 Reply Last reply
            0
            • R rayjoslyn

              It is my class with a base class of CMFCToolBar

              S Offline
              S Offline
              sashoalm
              wrote on last edited by
              #6

              See if CMFCToolBar::LoadState[^] is called. Find it in the MFC sources and put a breakpoint on it. On my computer it's in C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\src\mfc\afxtoolbar.cpp

              There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal

              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