Hi
I wish to use a .ini file to store values such as resolution, windowed mode etc. Does the GetPrivateProfileInt generate an ini file if it does not exist, or do I need to do that with CreateFile myself?
Also, if GetPrivateProfileInt does not find the key it is looking for, it takes the default. But does it update the ini file with the new default key?
I want my application to be able to generate a new ini file if it is missing, populating it with sections and keys with defaulted values at start up.
GetPrivateProfileInt - generation of ini file
Started by Tispe, Sep 12 2012 10:49 AM
3 replies to this topic
Ad:
#3 Members - Reputation: 839
Posted 12 September 2012 - 12:18 PM
Hi Tispe!
I recommend that you write your own config file. Step on the. ini -extension to conveniently associate the file type with notepad on windows, or use a different extension.
Create a simple parser, and don't delve into how anyone thinks you should be doing it. Chances are they'll deprecate it soon anyway.
You can learn much from parsing, - and using files on relative paths rather than utilizing the windows registry means portability for your application.
Sorry for not actually answering your question. ;)
I recommend that you write your own config file. Step on the. ini -extension to conveniently associate the file type with notepad on windows, or use a different extension.
Create a simple parser, and don't delve into how anyone thinks you should be doing it. Chances are they'll deprecate it soon anyway.
You can learn much from parsing, - and using files on relative paths rather than utilizing the windows registry means portability for your application.
Sorry for not actually answering your question. ;)
#4 Members - Reputation: 368
Posted 12 September 2012 - 02:10 PM
I always hate these windows functions that take wide chars. I get all kinds of compiler errors relating to LPCWSTR. I need to add 5 lines of code for each function call just to do conversion.......
Why aren't there a "WritePrivateProfileInt"???
Why aren't there a "WritePrivateProfileInt"???
Edited by Tispe, 12 September 2012 - 02:14 PM.






