- // is it really nMagic?
-// lVal = GetPrivateProfileInt(m_strGroup, strKey, nMagic2, m_strLocalFilename);
- if ( lVal == nMagic2 ) {
- // the nMagic it returned was indeed read from the file
- *pl = lVal;
- return TRUE;
- }
+ // hack: we have no mean to know if it really found the default value or
+ // didn't find anything, so we call it twice
+
+ static const int nMagic = 17; // 17 is some "rare" number
+ static const int nMagic2 = 28; // arbitrary number != nMagic
+ long lVal = 0; // = GetPrivateProfileInt(m_strGroup, strKey, nMagic, m_strLocalFilename);
+
+ if ( lVal != nMagic )
+ {
+ // the value was read from the file
+ *pl = lVal;
+ return true;
+ }
+
+ // is it really nMagic?
+ // lVal = GetPrivateProfileInt(m_strGroup, strKey, nMagic2, m_strLocalFilename);
+ if ( lVal == nMagic2 )
+ {
+ // the nMagic it returned was indeed read from the file
+ *pl = lVal;
+ return true;
+ }