Print Page | Close Window

SaveCommanbars to ini 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=6202
Printed Date: 04 October 2024 at 11:14pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: SaveCommanbars to ini file?
Posted By: grade
Subject: SaveCommanbars to ini file?
Date Posted: 24 January 2007 at 4:35am

Hello,

           If i want to SaveCommandBars (LoadCommandBars)  to(from)  ini file,How to do?Thank you for you help!


-------------
Grade Wang
Software Engineer



Replies:
Posted By: Oleg
Date Posted: 24 January 2007 at 5:36am
Hi,
 
See Samples\UserInterface\GUI_VisualStudio  (GUI_Whidbey)


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


Posted By: grade
Date Posted: 25 January 2007 at 3:00pm

Hello Sir,

              I reference to GUI_VisualStudio Sample, I used to two CXTPPropExchangeIniFile Object in my project.  The m_pxWriteIniFile is CXTPPropExchangeIniFile object, I call to SaveToFile function is no problem. but The m_pxReadIniFile(CXTPPropExchangeIniFile  object) call  to LoadFromFile function have two status for GetCommandBars(). I attached commandbar.zip for this post.
1. Due to  a software update the toolbar " has change......
2. stop in GetCommandBars()->DoPropExchange(&pxCommandBars, &param) command.
Can you any suggestions for me? Thank you for you help! https://forum.codejock.com/uploads/20070125_150025_commandbar.zip - uploads/20070125_150025_commandbar.zip



-------------
Grade Wang
Software Engineer


Posted By: Oleg
Date Posted: 26 January 2007 at 1:41am
Hi,
 
You don't need  save pointer. Use this code:
 
To Load:
CXTPPropExchangeIniFile  px(TRUE, 0, _T("Settings"));
 if (px.LoadFromFile(m_strIniFileName))
 {
  GetCommandBars()->DoPropExchange(&px, NULL);
}
 
To Save:
 
CXTPPropExchangeIniFile  px(FALSE, 0, _T("Settings"));
 if (px.OnBeforeExchange())
 {
  GetCommandBars()->DoPropExchange(&px);
  px.SaveToFile(m_strIniFileName);
 }


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


Posted By: grade
Date Posted: 26 January 2007 at 3:09am

Hello,

        The My Code is work. Thanks!
 
   


-------------
Grade Wang
Software Engineer



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