Docking Panes Layout Serialization |
Post Reply |
Author | |
singulus
Newbie Joined: 16 September 2004 Location: Bulgaria Status: Offline Points: 11 |
Post Options
Thanks(0)
Posted: 21 September 2004 at 5:01am |
Hello, I need to serialize the docking pane's layout into a CArchive object (e.g. I need to use the classic MFC way of data serialization). However I could not find a way to do this with the support of the XTP Toolkit. I noticed that the layout can only be stored in the system registry. Is there any approach to store the layout in a CArchive? It is really important to serialize the layout this way! Thanks to you all :) |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Sorry you only can store it to XML node, then to string, then to archive. BSTR CDockingPaneCtrl::OleSaveStateToString() MSXML::IXMLDOMDocumentPtr xmlDocPtr = 0; VERIFY(SUCCEEDED(xmlDocPtr.CreateInstance(MSXML::CLSID _DOMDocument))); xmlDocPtr->createElement(_bstr_t(_T("Layout")), &xmlRootPtr);
layout.SaveToNode(xmlDocPtr, xmlRootPtr, _T("Common")); BSTR bstrString = NULL; return bstrString; MSXML::IXMLDOMDocumentPtr xmlDocPtr = 0; VERIFY(SUCCEEDED(xmlDocPtr.CreateInstance(MSXML::CLSID _DOMDocument))); BSTR bstrRootName = 0;
if (layout.LoadFromNode(xmlDocPtr, xmlRootPtr, _T("Common")))
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
singulus
Newbie Joined: 16 September 2004 Location: Bulgaria Status: Offline Points: 11 |
Post Options
Thanks(0)
|
Thanks, It worked ! There is one more thing about the serialization problem. I need to support serialization versions. There is a problem when the a future version contains more docking panes than the current one. If I deserialize the old version the new version's docking panes won't be created but they should be available since the new version of the product requires them! Is there a way to "merge" the two layouts so the result contains the union of all docking panes?
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
No. You can serialize your version version to archive and check it before restore layout.
|
|
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 |