Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Docking Pane
  New Posts New Posts RSS Feed - SaveState and LoadState
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

SaveState and LoadState

 Post Reply Post Reply
Author
Message
Carlos Rocha View Drop Down
Groupie
Groupie


Joined: 11 February 2008
Location: Portugal
Status: Offline
Points: 92
Post Options Post Options   Thanks (0) Thanks(0)   Quote Carlos Rocha Quote  Post ReplyReply Direct Link To This Post Topic: SaveState and LoadState
    Posted: 19 April 2010 at 1:17am
Hi,

I want to save user layout preferences in a database to use in the next program execution. For this I'm saving the result of SaveLayoutToString.

In the next execution the initial layout is the original, and then I call LoadLayoutFromString. The layout changes like expected, but with empty panes. When I try to reassign the handles the program crashes.

Does this have a solution, or do I have to parse the XML and use the relevant values in the CreatePane method?


SuitePro 20.3.0
OS: Windows 10
Language: Visual Objects 2.8
Back to Top
pate View Drop Down
Groupie
Groupie


Joined: 27 April 2009
Status: Offline
Points: 36
Post Options Post Options   Thanks (0) Thanks(0)   Quote pate Quote  Post ReplyReply Direct Link To This Post Posted: 11 May 2010 at 1:11pm
That's the way I do it, after I load the Layout from string, the first thing I do is set the handles of the container controls:
 
For J = 1 To .PanesCount
        DockingPaneManager.Panes(J).SetHandle Elastic(J).hwnd
Next J
    
then set some other stuff like titles, colors, and pane options.
Back to Top
Carlos Rocha View Drop Down
Groupie
Groupie


Joined: 11 February 2008
Location: Portugal
Status: Offline
Points: 92
Post Options Post Options   Thanks (0) Thanks(0)   Quote Carlos Rocha Quote  Post ReplyReply Direct Link To This Post Posted: 11 May 2010 at 4:46pm
Thank you for pulling in

But I'm not sure if I understand you. Do you re-assign the handles after LoadLayoutFromString, or the first thing you do is loading the layout and only then assign the handles (didn't try this yet)?
SuitePro 20.3.0
OS: Windows 10
Language: Visual Objects 2.8
Back to Top
pate View Drop Down
Groupie
Groupie


Joined: 27 April 2009
Status: Offline
Points: 36
Post Options Post Options   Thanks (0) Thanks(0)   Quote pate Quote  Post ReplyReply Direct Link To This Post Posted: 11 May 2010 at 4:56pm
<<<<<
Do you re-assign the handles after LoadLayoutFromString, or the first thing you do is loading the layout and only then assign the handles
>>>>>
Not sure I understand your question, aren't these two the same thing?  Each pane has a container control.  After I do ANY Load from string, I have to assign the handles whether it is the first time thru, or if the user is loading in a different layout.
Back to Top
Carlos Rocha View Drop Down
Groupie
Groupie


Joined: 11 February 2008
Location: Portugal
Status: Offline
Points: 92
Post Options Post Options   Thanks (0) Thanks(0)   Quote Carlos Rocha Quote  Post ReplyReply Direct Link To This Post Posted: 11 May 2010 at 5:44pm
In my case if I load a layout AFTER assigning the handles the panes become empty, and if I assign again the handles the program crash.
I presume you can (re)assign the handles at any time, right?
SuitePro 20.3.0
OS: Windows 10
Language: Visual Objects 2.8
Back to Top
pate View Drop Down
Groupie
Groupie


Joined: 27 April 2009
Status: Offline
Points: 36
Post Options Post Options   Thanks (0) Thanks(0)   Quote pate Quote  Post ReplyReply Direct Link To This Post Posted: 11 May 2010 at 6:02pm
Yes, I have no problem reassigning them multiple times.  Using VB6 SP6, and picture boxes as the container controls.  I have several preset layouts that the user can load from string.  Each time, it loads the layout, then I assign the handles to the panes, then set the titles, color, and pane options.  I've never seen it crash, so I assume it is very possible to do.
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: 14 May 2010 at 4:52am
You have first define the layout by LoadLayoutxxx.
If LoadLayou doesn't create panes, you can create a default-layout.
 
To attach the panes, you have to use the DockingPane_AttachPane-Event.
Depending on the associated Item.Id-Property you can than create and attach the corresponding forms/pictureboxes.
Define a unique Id for the type of pane.
 
The reason is, that LoadLayout destroyes all prevoius created panes and create new panes on the loaded layout.
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.141 seconds.