Professional UI Solutions
Site Map   /  Register


Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » Problem in restoring customized toolbar Collapse All
Subject Author Date
anil vyas May 18, 2007 - 6:46 AM

By using the Customized dialog box,I am trying to create toolbar buttons with drag and drop facility. Now I want that in my application, my customized toolbar should be saved as per project. That is if I have created two project i.e. Pr1 and Pr2. In Pr1, I have created two toolbars button using customized dialog box. In Pr2, I have not created any toolbar. Now whenever I open Pr1 through my application all toolbars including two toolbars button created through customize dialog box should be seen, but when I open new project or Pr2 this toolbar button should not be seen. How this is possible?

Technical Support May 18, 2007 - 11:35 AM

If you want to use the same toolbars bars and menus in both of your project, then you need to check the following:

1) Both projects should use the same command identifiers for all the commands in toolbars and menus.

2) Both projects should save/restore the states of command manager, customize site and control bars to/from the same location in the registry (or file on disk). So, you should check the string variables passed as parameters to the state saving/loading APIs in both projects. These APIs are typically invoked in the CMainFrame::OnCreate() and CMainFrame::DestroyWindow() methods.

anil vyas May 21, 2007 - 11:37 PM

I think u still confused about what i need.So i want make you again more clear about it by example.I have one toolbar name as draw toolbar.and i have two projects pr1 and pr2.While using pr1 i have made changes to this toolbar by using drag-drop facility of customization.and while using pr2 i made different change to same toolbar differently.So i have made different change in same toolbar in both project.So corresponding chages should be reflected in both project when i open project .So i will get different changes in different project on same toolbar. How is it possible?Waiting for ur early reply.

Technical Support May 22, 2007 - 7:33 AM

You will see the changes from both applications if you run one application and modify the toolbar in it, close it, run the second application and modify the toolbar in it, close it, run any of them. The changes will not be visible if both applications are running at the same time. Of course, you should follow the project development recommendations which we provided in our previous answer.

anil vyas May 23, 2007 - 12:50 AM

What I meant with two project is the same as in Microsoft word, 2 new documents. I have my application(similar to Microsoft Word) in which I can create 2 new projects(similar to which I can create 2 new documents). Now in one projects, using the customized dialog box I can create a toolbar button and using drag drop facility I place it on the toolbar. When I open the second project, this toolbar or toolbar button should not be visible. How this is possible?


Technical Support May 23, 2007 - 9:35 AM

It is possible to serialize the UI state into a CArchive MFC archive. This means it is possible to save the UI state into document data. So if you open the same document file in two different applications, they will load the UI state saved in the document. Is that what you need?

anil vyas May 29, 2007 - 6:47 AM

Tnanks for replying.i am trying to do it but not able to do.i m using CustomizeStateSave() when i do close project and CustomizeLoadState() when i open project.It functions properly but when i open project it shows only ToolBar in which i added button through customization other ToolBars r displyed but blank(without buttons) and also i want to save state of all the bars.

Waiting for ur early reply

Technical Support May 29, 2007 - 10:19 AM

It seems we need to take a look at your projects so that we can help you more efficiently. If you have a valid subscription please send your projects to