float getIniValueAsFloat(LPCSTR section, LPCSTR key, LPCSTR iniFile) { DWORD length = ::GetPrivateProfileString(section, key, "0", NULL, 0, iniFile); if(length > 0) { TCHAR* value = new TCHAR[length + 1]; ::GetPrivateProfileString(section, key, "0", value, length, iniFile); return atof(value); } return 0; }