Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - Save/Load State
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Save/Load State

 Post Reply Post Reply
Author
Message
griswald88 View Drop Down
Groupie
Groupie


Joined: 16 May 2008
Status: Offline
Points: 27
Post Options Post Options   Thanks (0) Thanks(0)   Quote griswald88 Quote  Post ReplyReply Direct Link To This Post Topic: Save/Load State
    Posted: 22 July 2008 at 2:31pm
I have commandbars that have embedded controls (i.e. combo box and textbox) and I am trying to save and reload the state of the bars.  When I reload the state, the controls are missing and the commandbar height is much larger.  Is there something I am doing wrong?
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 23 July 2008 at 1:46am

Hi,

Can you modify some our project and attach to check what you do.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
griswald88 View Drop Down
Groupie
Groupie


Joined: 16 May 2008
Status: Offline
Points: 27
Post Options Post Options   Thanks (0) Thanks(0)   Quote griswald88 Quote  Post ReplyReply Direct Link To This Post Posted: 23 July 2008 at 8:36am
Here is a modified SDISample project.  Please note it will ask you if it is the first time running the sample, so the 1st time, select YES.  Once the sample loads and displays move the toolbars around and then close the form (end the project).  Start it up again and this time, answer NO to "is this the first time running the sample, this will attempt to reload the last state.  Note how the controls are missing.  Am I doing something wrong?uploads/20080723_083639_SDISample.zip
Back to Top
Baldur View Drop Down
Senior Member
Senior Member


Joined: 22 November 2006
Location: Germany
Status: Offline
Points: 244
Post Options Post Options   Thanks (0) Thanks(0)   Quote Baldur Quote  Post ReplyReply Direct Link To This Post Posted: 23 July 2008 at 2:06pm
If you add custom-controls, you add its handle (the hwnd-property).
This handle will be changed with very start, so you can't save this state.
After load state, you have to reassign the custom controls with the new handles.
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 24 July 2008 at 4:57am
Hi,
 
yes, reason that hwnd will be new. As solution you can set Customizable = False for toolbar with custom controls or manually restore handle of custom control.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
griswald88 View Drop Down
Groupie
Groupie


Joined: 16 May 2008
Status: Offline
Points: 27
Post Options Post Options   Thanks (0) Thanks(0)   Quote griswald88 Quote  Post ReplyReply Direct Link To This Post Posted: 24 July 2008 at 8:19am
Customizable IS false, but the user is still able to modify the toolbar's position...so I also want to restore this new position (without using registry)
Back to Top
Baldur View Drop Down
Senior Member
Senior Member


Joined: 22 November 2006
Location: Germany
Status: Offline
Points: 244
Post Options Post Options   Thanks (0) Thanks(0)   Quote Baldur Quote  Post ReplyReply Direct Link To This Post Posted: 24 July 2008 at 2:32pm
Use the FindControl-Method and assign the new handle.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.172 seconds.