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