Print Page | Close Window

Help! How to save QAT to our file?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=17806
Printed Date: 28 November 2024 at 8:37pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Help! How to save QAT to our file?
Posted By: rdhd
Subject: Help! How to save QAT to our file?
Date Posted: 24 January 2011 at 1:23pm
I need to save out the QAT and command bar settings to our xml based customization file. I am creating an XML element in our file and obtaining the CXTPDOMNodePtr from the element, setting up a prop exchange object and call DoPropExchange. But when I am finished and I save the DOM data to a file, no command bar data appears. I have stepped thru the CJ code and I see calls that appear to be writing data. But where is the data?
 
I have been able to write out data when I don't pass in the xml node and later call  px.SaveToFile but in this case I provide the node in our file so I can capture the data in our file (I need to write out multiple QATs and command bar settings for each MDI document type we support).

if (m_pElement)

{

CXTPDOMNodePtr pNode = m_pElement;

if( pNode )

{

CXTPPropExchangeXMLNode px( FALSE, pNode, _T("Settings") );

if( px.OnBeforeExchange() )

{

CXTPPropExchangeSection pxCommandBars( px.GetSection( _T("CommandBars") ) );

XTP_COMMANDBARS_PROPEXCHANGE_PARAM param;

param.bSerializeControls = TRUE;

param.bSaveOriginalControls = FALSE;

param.bSerializeOptions = TRUE;

pCommandBars->DoPropExchange( &pxCommandBars, &param );

}

}

}

What is wrong with the above code? OR what do I do to get the command bar data written to our file (along with other data we write in the file)?




Replies:
Posted By: rdhd
Date Posted: 24 January 2011 at 2:34pm
Doh! I wasn't appending the element to my root node!
 
I made a call to save to a file (which I had written earlier) where I don't create the node for the constructor call (px variable) and for which I call px.SaveToFile with a temp file. Data was saved. I then quit concentrating on setting up and performing the prop exchange and realized I created an element but didn't do anything with it except use it for the prop exchange!.


Posted By: Oleg
Date Posted: 25 January 2011 at 7:28am
Hope it works now :)

-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net