Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - SaveCommanbars to ini file?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

SaveCommanbars to ini file?

 Post Reply Post Reply
Author
Message
grade View Drop Down
Newbie
Newbie
Avatar

Joined: 07 December 2006
Location: Taiwan
Status: Offline
Points: 25
Post Options Post Options   Thanks (0) Thanks(0)   Quote grade Quote  Post ReplyReply Direct Link To This Post Topic: SaveCommanbars to ini file?
    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
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: 24 January 2007 at 5:36am
Hi,
 
See Samples\UserInterface\GUI_VisualStudio  (GUI_Whidbey)
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
grade View Drop Down
Newbie
Newbie
Avatar

Joined: 07 December 2006
Location: Taiwan
Status: Offline
Points: 25
Post Options Post Options   Thanks (0) Thanks(0)   Quote grade Quote  Post ReplyReply Direct Link To This Post 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!uploads/20070125_150025_commandbar.zip

Grade Wang
Software Engineer
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: 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
Back to Top
grade View Drop Down
Newbie
Newbie
Avatar

Joined: 07 December 2006
Location: Taiwan
Status: Offline
Points: 25
Post Options Post Options   Thanks (0) Thanks(0)   Quote grade Quote  Post ReplyReply Direct Link To This Post Posted: 26 January 2007 at 3:09am

Hello,

        The My Code is work. Thanks!
 
   
Grade Wang
Software Engineer
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.