SaveStateToString/LoadStateFromString |
Post Reply |
Author | |
cgaskill
Newbie Joined: 13 April 2006 Location: United States Status: Offline Points: 15 |
Post Options
Thanks(0)
Posted: 19 February 2008 at 2:59pm |
I am having an issue with the SaveStateToString/LoadStateFromString methods. The string is saved to/loaded from a database. The calls are being made as follows:
sLayout = Me.CommandBars.SaveStateToString(True, True, True) Call Me.CommandBars.LoadStateFromString(sLayout, True, True) I am on version 9.7. The designer is not used. We create the menu & toolbary at runtime. After the menu & toolbar have been created we load the layout string (if applicable) to restore any customizations done. Here is the scenario: 1) 'Fresh Start - No Customization Done LOAD CommandBarLayout Size = 0 SAVE CommandBarLayout Size = 14768 2) 'Reload after No Customization Done, Still No Customization Done LOAD CommandBarLayout Size = 14768 SAVE CommandBarLayout Size = 680 3) 'Reload after Still No Customization Done - Remove some items from toolbar LOAD CommandBarLayout Size = 680 SAVE CommandBarLayout Size = 14396 4) 'Reload afer Remove some items from toolbar - Loads OK - No More Customization Done LOAD CommandBarLayout Size = 14396 SAVE CommandBarLayout Size = 680 5) 'Reload after No More Customization Done - Lost Customization from Step 3 LOAD CommandBarLayout Size = 680 SAVE CommandBarLayout Size = 14768 As you can see, when we closed the application the 2nd time still making no changes to the original layout loaded in step 1 the size is much smaller. Then the 3rd time we go in, we make some changes and we we go back in in step 4 those changes are kept; however, when we close the application the 4th time (making not additional changes from when we went in the 3rd time) the size is much smaller (not the same size as when we made the changes and closed in step 3). Therefore, when we load again in step 5 our changes are lost. Any thoughts and what I am doing wrong here? Thanks. |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
9.7 version is too old, Try to check it with last eval version.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
cgaskill
Newbie Joined: 13 April 2006 Location: United States Status: Offline Points: 15 |
Post Options
Thanks(0)
|
Same result.
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
We need some sample to debug it.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
cgaskill
Newbie Joined: 13 April 2006 Location: United States Status: Offline Points: 15 |
Post Options
Thanks(0)
|
Here is a test app that shows how I am using the CommandBars control. To replicate issue do the following.
1) Launch App 2) Remove a control from the toolbar. 3) Close App 4) Re-Launch App - Toolbar is restored properly (the item that was removed is still removed). 5) Close App 6) Re-Launch App - Toolbar is not restored properly (the item that was removed is back, toolbar looks as it did when we first launched in step 1). uploads/20080221_100235_TestApp.zip |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Just switch
Call Me.CommandBars.EnableCustomization(True)
and Call LoadPreferences
p.s. for main menu items better use xtpControlPopup than xtpControlButtonPopup
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
cgaskill
Newbie Joined: 13 April 2006 Location: United States Status: Offline Points: 15 |
Post Options
Thanks(0)
|
Great, thanks. I was wondering if re-ordering would make a difference. Just wasn't sure where to start.
|
|
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 |