Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - State Saving into wrong folder
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

State Saving into wrong folder

 Post Reply Post Reply
Author
Message
danpetitt View Drop Down
Senior Member
Senior Member


Joined: 17 July 2005
Location: United Kingdom
Status: Offline
Points: 109
Post Options Post Options   Thanks (0) Thanks(0)   Quote danpetitt Quote  Post ReplyReply Direct Link To This Post Topic: State Saving into wrong folder
    Posted: 23 July 2006 at 2:54am
The LoadCommandBars and SaveCommandBars functions appear to save into the folder:
C:\Documents and Settings\USERNAME\Application Data\APPNAME
 
This is not what I want and a bit different to every other application. It ought to save into a sub-folder (normally the company name). This is what its like in the Software section of registry as its what you use "SetRegistryKey" for.
 
So we could (and should) use this value in the command bar load/save thus:
 
Change "CXTPCommandBars::GetIsolatedFileName"...
 strAppDataFolder += CString(_T("\\")) + AfxGetApp()->m_pszAppName;
 CreateDirectory(strAppDataFolder, NULL);
 
To...
 strAppDataFolder += CString(_T("\\")) + AfxGetApp()->m_pszRegistryKey;
 CreateDirectory(strAppDataFolder, NULL); // Create directory will not create missing folders so we have to create them as we go
 strAppDataFolder += CString(_T("\\")) + AfxGetApp()->m_pszAppName;
 CreateDirectory(strAppDataFolder, NULL);

Any chance this can be fixed/improved??
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


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: 23 July 2006 at 10:40am
Hello,
 
See SetCustomizationDataFileName method.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
danpetitt View Drop Down
Senior Member
Senior Member


Joined: 17 July 2005
Location: United Kingdom
Status: Offline
Points: 109
Post Options Post Options   Thanks (0) Thanks(0)   Quote danpetitt Quote  Post ReplyReply Direct Link To This Post Posted: 23 July 2006 at 3:18pm
Thanks, but there is still a lot of stuff saved in the registry.
 
If I add an icon to the toolbar (I think also if i customise the shortcuts), that info appears to be saved in the registry.
 
There are also loads of reg items starting: "CommandBars" like "CommandBars-Bar0", "CommandBars-Options" etc.
Back to Top
danpetitt View Drop Down
Senior Member
Senior Member


Joined: 17 July 2005
Location: United Kingdom
Status: Offline
Points: 109
Post Options Post Options   Thanks (0) Thanks(0)   Quote danpetitt Quote  Post ReplyReply Direct Link To This Post Posted: 23 July 2006 at 3:41pm
It might be easier if we continue/merge this topic into this one:
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.047 seconds.