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