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
Do you really need a .ini file? From the doc:
Note This function is provided only for compatibility with 16-bit Windows-based applications. Applications should store initialization information in the registry.
Note This function is provided only for compatibility with 16-bit Windows-based applications. Applications should store initialization information in the registry.
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. ;)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement