Read ini file?
-
I have a program with some ini profile files. For dynamicly changing profile files when the app is running, i change the m_pszProfileName value which is a attribute of the App Class. But some problems bother me, the values are loaded correctly for each ini file when the app first running, while it does'nt work after i changed the m_pszProfileName value when the app run. Can anybody help me? Thanks.
void update() { .... free((void*)m_pszRegistryKey); m_pszRegistryKey = NULL; free((void*)m_pszProfileName); m_pszProfileName =_tcsdup(szPath); ....} ... { AfxGetApp()->GetProfileString(......); } ...
hi -
I have a program with some ini profile files. For dynamicly changing profile files when the app is running, i change the m_pszProfileName value which is a attribute of the App Class. But some problems bother me, the values are loaded correctly for each ini file when the app first running, while it does'nt work after i changed the m_pszProfileName value when the app run. Can anybody help me? Thanks.
void update() { .... free((void*)m_pszRegistryKey); m_pszRegistryKey = NULL; free((void*)m_pszProfileName); m_pszProfileName =_tcsdup(szPath); ....} ... { AfxGetApp()->GetProfileString(......); } ...
hiYou can check in sources what is wrong there (maybe it caches open file handle), but why don't you use GetPrivateProfilexxx functions directly? Igor Green http://www.grigsoft.com/ - files and folders comparison tools
-
I have a program with some ini profile files. For dynamicly changing profile files when the app is running, i change the m_pszProfileName value which is a attribute of the App Class. But some problems bother me, the values are loaded correctly for each ini file when the app first running, while it does'nt work after i changed the m_pszProfileName value when the app run. Can anybody help me? Thanks.
void update() { .... free((void*)m_pszRegistryKey); m_pszRegistryKey = NULL; free((void*)m_pszProfileName); m_pszProfileName =_tcsdup(szPath); ....} ... { AfxGetApp()->GetProfileString(......); } ...
hi -
I have a program with some ini profile files. For dynamicly changing profile files when the app is running, i change the m_pszProfileName value which is a attribute of the App Class. But some problems bother me, the values are loaded correctly for each ini file when the app first running, while it does'nt work after i changed the m_pszProfileName value when the app run. Can anybody help me? Thanks.
void update() { .... free((void*)m_pszRegistryKey); m_pszRegistryKey = NULL; free((void*)m_pszProfileName); m_pszProfileName =_tcsdup(szPath); ....} ... { AfxGetApp()->GetProfileString(......); } ...
hizt9788 wrote:
But some problems bother me, the values are loaded correctly for each ini file when the app first running, while it does'nt work after i changed the m_pszProfileName value when the app run.
try these INI file reading wrapper class:- INI FILE reader![^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV