Thanks for all help!
Please answer only to my e-mail address: Frank....@mchp.siemens.de
Frank Jermann wrote in message <3608F034...@mchp.siemens.de>...
Get/WriteProfileInt
Get/WriteProfileString
Get/WriteProfileSection
Also available as CWinApp methods - declare "extern CMyApp theApp" in header file and you can use theApp.Get/WriteProfile* methods everywhere in your project.
CWinApp::m_pszProfileName contains the name of the application’s .INI file. Use SetRegistryKey(...) when you would like to use registry instead of INI files.
ChainsaW
// Set up the path to the INI file
// First free the string allocated by MFC at CWinApp startup.
// The string is allocated before InitInstance is called.
free((void*)m_pszProfileName);
//Change the name of the .INI file; it is located in working directory
char workingDir[_MAX_PATH+1] = "";
CString cfgPath;
if (_getcwd(workingDir, _MAX_PATH)) {
cfgPath = workingDir;
cfgPath += "\\";
cfgPath += CONFIG_FILENAME;
}
else { // try root direcotry
cfgPath = "c:\\";
cfgPath += CONFIG_FILENAME;
}
//The CWinApp destructor will free this memory.
m_pszProfileName=_tcsdup(_T(cfgPath));
You can then use the Get/WriteProfileString and Get/WriteProfileInt
methods that are part of CWinApp. Info will get written to the INI file
you specified in InitInstance.
--
~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
~ Tim Morgan
~ Programmer/Analyst
~ Envoy Global, Inc. *Internet Conferencing Solutions*
~ tmo...@envoyglobal.com
~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Frank Jermann wrote:
> I am searching for a class that allows me to read an INI file with all
> sections and tags, modify them and store them back to the INI file. I
> think it must be available, or not?
>
Lance
lov...@iftech.com
Interface Technologies, Inc.
http://devcentral.iftech.com
http://codevizor.iftech.com
Frank Jermann wrote in message <3608F034...@mchp.siemens.de>...