Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Storing Profile Values in an INI File
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Storing Profile Values in an INI File

 Post Reply Post Reply
Author
Message
IRMark View Drop Down
Groupie
Groupie
Avatar

Joined: 13 July 2006
Status: Offline
Points: 30
Post Options Post Options   Thanks (0) Thanks(0)   Quote IRMark Quote  Post ReplyReply Direct Link To This Post Topic: Storing Profile Values in an INI File
    Posted: 14 July 2006 at 10:38am

Hi Everyone,

I've searched the forums but have been unable to find an answer to this situation.  Hopefully it's something simple and I've just missed a step.

I'm working on a new application and in order to make it more compatible with Windows Vista and the expectations of Vista I'm attempting to store my applications profile values in an INI file in the "Application Data" folder rather then in the registry.

According to the MSDN documentation you can accomplish this by settings the CWinApp member m_pszProfileName and not calling SetRegistryKey() at all.

When I do this my application and the Xtreme ToolkitPro stores the profile values in the INI file properly, however when I run the debug version I get asserts when the program starts and when it closes.

The asserts are coming from the following lines:


HKEY  hKey = AfxGetApp()->GetAppRegistryKey();


in


void CXTPCommandBars::LoadOptions(LPCTSTR lpszProfileName)


When I start and exit the application and:


HKEY hRoot = AfxGetApp()->GetSectionKey(_xtRootSection);
ASSERT(hRoot);


in


void CXTPDockingPaneLayout::Save(LPCTSTR strSection)


when I exit the application and then finally an exception from this line:


AfxDelRegTreeHelper(m_hParentKey, m_strSectionName);


in


void CXTPPropExchangeRegistry::EmptySection()


when exiting the program.

So my question is, what am I missing?  How can I configure the Xtreme Toolkit Pro (10.2) to use the INI file specified and ignore the registry?  If I ignore all of the asserts and continue everything seems to work fine but this does not seem to be the correct way to do things.

Any and all help is very appreciated!

Thanks!

mark.

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: 14 July 2006 at 12:50pm
Hello,
Unfortunatelly SaveCommandBars/LoadCommandBars don't support ini files. you can save/load setting in XML file (see for example GUI_Whidbey sample)
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
IRMark View Drop Down
Groupie
Groupie
Avatar

Joined: 13 July 2006
Status: Offline
Points: 30
Post Options Post Options   Thanks (0) Thanks(0)   Quote IRMark Quote  Post ReplyReply Direct Link To This Post Posted: 14 July 2006 at 3:55pm

Hi Oleg,

Thanks for the response!  I was looking at the source code a bit more and noticed that the first ASSERT if coming (originally) from the XTPFrameWnd's function LoadCommandBars where the source code says the following:


//-----------------------------------------------------------------------
    // Summary:
    //     Call this function to retrieve state information from the registry
    //     or .INI file.
    // Parameters:
    //     lpszProfileName - Points to a null-terminated string that specifies
    //                       the name of a section in the initialization file
    //                       or a key in the Windows registry where state
    //                       information is stored.
    //     bSilent         - TRUE to disable user notifications when command bars are restore to their original state.
    //-----------------------------------------------------------------------


The same goes to the source documentation for the CXTPCommandBars::LoadOptions() function.  Am I to assume that the comments left in the source are no longer accurate and were left in error?

It's a shame that the toolkit cannot use the registry or the profile INI file interchangeably but being able to use an XML file should solve my problems.  Thanks for the information.



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: 15 July 2006 at 11:15am
Hello, Actually you right.... For 10.3 we added support of ini too.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
IRMark View Drop Down
Groupie
Groupie
Avatar

Joined: 13 July 2006
Status: Offline
Points: 30
Post Options Post Options   Thanks (0) Thanks(0)   Quote IRMark Quote  Post ReplyReply Direct Link To This Post Posted: 17 July 2006 at 9:51am
Originally posted by oleg oleg wrote:

Hello, Actually you right.... For 10.3 we added support of ini too.


Hi Oleg,

I'm not quite sure what you mean?  Do you mean that there is support for INI files in 10.2 or that I was right in saying that there are errors in the source comments?

When is version 10.3 being released?

mark.

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: 17 July 2006 at 12:54pm
Hello,
 
I mean that you was right that LoadOptions had bug when ini file must be used.  For 10.3 we fixed it and it will work right.
 
We plan to release 10.3 in beginning of August.
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 4:21am

Is this on its way ... I really need the ini file saving/loading??

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.172 seconds.