Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » Putting own settings in profile/registry Collapse All
Subject Author Date
Suhai Gyorgy Sep 26, 2005 - 7:09 AM

Hi!


I`m trying to find an easy and working way to put some custom settings in the registry along with the information about menu/toolbar and commands. A setting like this could be e.g. header-order/sortment of my listcontrol in report view.


I have done some searching on this subject, looking at the source-code of CExtCmdManager, CExtCmdProfile, etc. I`m guessing a working way could be the following:


1. Derive a class from CExtCmdProfile, override SerializeState(CArchive & ar) function, putting/getting my own settings in/from the ar as well. (CMyCmdProfile)


2. Derive a class from CExtCmdManager, override ProfileGetPtr(sProfileName) function, so that it would return a CMyProfile*. (CMyCmdManager)


3. use reinterpret_cast<CMyCmdManager*>(g_CmdManager->)... wherever necessary.


My question would be: isn`t there an easier way? And would this way work at all?


While waiting for your answer, I`ll be working on this version but I`m afraid it might not work.


Thank you in advance: Chris.

Technical Support Sep 26, 2005 - 10:30 AM

We suggest you not change behavior of the command manager. Instead just use the WriteProfileString/GetProfileString, WriteProfileInt/GetProfileInt or WriteProfileBinary/GetProfileBinary methods of the CWinApp class. These methods are used for saving/loading the user data into/from the specified section of the application’s registry or INI file.