GetProfileInt
-
I created the .ini file manually in C:\ drive and added following [Section] a=1 b=2
CWinApp *pApp = AfxGetApp(); free((void*)pApp->m_pszProfileName); pApp->m_pszProfileName = _tcsdup("C:\\myfile.ini"); pApp->GetProfileInt("Section", "a", 0);
But GetProfileInt() returns 0 instead of 1. I went through the registry. There was NO entry of ini section and entry, since i have created ini file manually. Whether GetProfileInt reads only registry or both registry and ini file? -
I created the .ini file manually in C:\ drive and added following [Section] a=1 b=2
CWinApp *pApp = AfxGetApp(); free((void*)pApp->m_pszProfileName); pApp->m_pszProfileName = _tcsdup("C:\\myfile.ini"); pApp->GetProfileInt("Section", "a", 0);
But GetProfileInt() returns 0 instead of 1. I went through the registry. There was NO entry of ini section and entry, since i have created ini file manually. Whether GetProfileInt reads only registry or both registry and ini file?You should use
GetPrivateProfileInt
[^].If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke -
You should use
GetPrivateProfileInt
[^].If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke