![]() |
Using XML bars customization |
Post Reply
|
| Author | |
yoavo
Senior Member
Joined: 29 February 2004 Location: Israel Status: Offline Points: 140 |
Post Options
Thanks(0)
Quote Reply
Topic: Using XML bars customizationPosted: 15 February 2006 at 3:44am |
|
Hi, In my application I use XML bars customization. I have about 4 DocTemplates and I want to store a different bars layout for each one of them. I prefer to work with one xml file (and make 4 different sections for each DocTemplate). My problem is that it looks like each time I use the method SaveToFile (of CXTPPropExchangeXMLNode), the file is written from scratch, and the previous sections are deleted. My question is: Can I do it with one XML file with 4 sections, or should I compromise on 4 different XML files for each layout ? Here is my code (which is called each time a different DocTemplate is load): CCimString aCustomizationFileName = GetCustomizationFileName(); Yoav.
|
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 15 February 2006 at 7:53am |
|
Just add px.LoadFromFile(aCustomizationFileName); after CXTPPropExchangeXMLNode px(FALSE, 0, _T("Settings")); |
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
yoavo
Senior Member
Joined: 29 February 2004 Location: Israel Status: Offline Points: 140 |
Post Options
Thanks(0)
Quote Reply
Posted: 01 March 2006 at 6:47am |
|
Hi Oleg, I tried to follow your instructions but I have some problems with this solusion (I tried to do it also in "Gui_Whidbey" sample and had the same problems as in my App ): 1. The size of the .xml file keeps growing each time I save the layout to the file. 2. The customization does not work OK (if I rename a menu item and run the application again, the renamed name is not restored). I think it happens because the section is not written from scrach and it contains "leftovers" of previous layout saving. Yoav. |
|
![]() |
|
yoavo
Senior Member
Joined: 29 February 2004 Location: Israel Status: Offline Points: 140 |
Post Options
Thanks(0)
Quote Reply
Posted: 02 March 2006 at 2:36am |
|
I also tried it in "Grep" sample (without changing the code) - in this sample you use the same solusion, and the problem exist there too: Try to rename a menu item by customization - it will not be kept, and the .xml file is growing each time you close the application. |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 02 March 2006 at 3:47pm |
|
To solve problem 1: replace param.bSaveOriginalControls = FALSE; to param.bSaveOriginalControls = TRUE;
To solve problem 2: call pxCommandBars->EmptySection(); before GetCommandBars()->DoPropExchange(&pxCommandBars, ¶m); |
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |