Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Help! How to save QAT to our file?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Help! How to save QAT to our file?

 Post Reply Post Reply
Author
Message
rdhd View Drop Down
Senior Member
Senior Member
Avatar

Joined: 13 August 2007
Location: United States
Status: Offline
Points: 886
Post Options Post Options   Thanks (0) Thanks(0)   Quote rdhd Quote  Post ReplyReply Direct Link To This Post Topic: Help! How to save QAT to our file?
    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)?

Back to Top
rdhd View Drop Down
Senior Member
Senior Member
Avatar

Joined: 13 August 2007
Location: United States
Status: Offline
Points: 886
Post Options Post Options   Thanks (0) Thanks(0)   Quote rdhd Quote  Post ReplyReply Direct Link To This Post 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!.
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: 25 January 2011 at 7:28am
Hope it works now :)
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
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.250 seconds.