Saving To an INI |
Post Reply |
Author | |
JamesC
Newbie Joined: 03 December 2003 Status: Offline Points: 21 |
Post Options
Thanks(0)
Posted: 18 December 2003 at 11:18am |
Does anyone know how to save to the INI file. SaveCommandBars Description says that 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.' I would like to know what is the initialization file and how do you specify it. My app has different users and each user will have a different layout. I need to be able to specify different INI file to save and load from. But I dont see how to specify the INI file to get the data from. Documentation states to hand it the Section name of the INI file.
|
|
JamesC
Newbie Joined: 03 December 2003 Status: Offline Points: 21 |
Post Options
Thanks(0)
|
Can ANYONE help me with this issue. It is rather important for our app to be able to save to multiple INI files. It appears that it will only save to the WIN.INI file. Is there any other way of saving the data.
Edited by JamesC |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
These functions decode/encode state to string. You can save this sting to INI or registry for each user. see: WritePrivateProfileString("CommandBars", "State", str, strPath);
void LoadStateFromString(CXTPCommandBars* pCommandBars, CString str, BOOL bSerializeControls) for (int i = 0; i < nLen; i += 2) CMemFile memFile(pData, nBytes); delete[] pData; } CString SaveStateToString(CXTPCommandBars* pCommandBars, BOOL bSerializeControls) try DWORD nBytes = (DWORD)memFile.GetPosition(); CString str; return str; Edited by oleg |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
timhards
Newbie Joined: 19 August 2004 Status: Offline Points: 1 |
Post Options
Thanks(0)
|
The LoadStateFromString and SaveStateToString functions that Oleg has given are incorrect (and don't compile). To correct them make the following changes. In LoadStateFromString, change: In SaveStateToString, change: Tim |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |