Hi HellOfMice,
It is interesting: I set edited my ini to be:
[Settings]
MaxCards=500
MainLeft=
MainTop=
MainWidth=727
MainHeight=526
DarkMode=0
[Display]
HideTools=
So three entries with no value. Then I just run the program - the window is drawn starting at 0,0.
Even though no value in the ini file. and the default values for the window as shown below are not 0,0
//size parameters from the ini
RetVal = GetPrivateProfileStringW(p_tmp, L"MainLeft", L"10",INIString,200, p_file);
MainForm.left= _wtoi(INIString);
RetVal = GetPrivateProfileStringW(p_tmp, L"MainTop", L"30",INIString,100, p_file);
MainForm.top= _wtoi(INIString);
RetVal = GetPrivateProfileStringW(p_tmp, L"HideTools", L"0", INIString,100,p_file);
StartUp.Hide_Toolbar = _wtoi(INIString);
So in C code it seems to be doing what you are wanting. Key Found, but empty, return 0
Perhaps in C the values are all ZERO when the INIStart structure is created?
So loading a default 0 into the storage of each INI entry might get you where you want to be?
Then if it fails that entry will have the 0.
John Z