CStdString k = key; k += "Count"; int size = GetPrivateProfileInt(VBA_PREF, k, -1, regVbaPath); if(size >= 0 && size < count) count = size;
BOOL regQueryBinaryValue(char * key, char *value, int count){  if(regEnabled) {    DWORD type = 0;    DWORD size = count;    DWORD result = 0;            LONG res = RegQueryValueEx(vbKey,                               key,                               NULL,                               &type,                               (UCHAR *)value,                               &size);        if(res == ERROR_SUCCESS && type == REG_BINARY)      return TRUE;    return FALSE;  }  return GetPrivateProfileStruct(VBA_PREF,                                 key,                                 value,                                 count,                                 regVbaPath);}