You get your default value specified in the 3rd parameter in the call to GetPrivateProfileInt(). Most certainly the "infoDat.ini" file is not properly formatted, or it cannot be located by a relative path. To remedy specify a full file path in the lpFileName parameter.
PS. You realize that GetPrivateProfileInt() API was deprecated in favor of the System Registry APIs, don't you?
The name of the initialization file. If this parameter does not contain a full path to the file, the system searches for the file in the Windows directory.
I did try and specify the full path but didn't work. And I also know GetPrivateProfileInt() API was deprecated in favor of the System Registry APIs, but in this situation, I have to use ini file.
You need to keep .ini file next to your executable wherever it is, Debug folder in case you run Debug build from VS IDE. I thought it'd easy to get from the source.
Bookmarks