if(res == ERROR_SUCCESS && type == REG_SZ)
return def; }  DWORD res = GetPrivateProfileString(VBA_PREF, key, def, (LPTSTR)buffer, 2048, VBA_INI);  if(res)
char *regQueryStringValue(char * key, char *def){  DWORD type = 0;  DWORD size = 2048;    LONG res = RegQueryValueEx(vbKey,                             key,                             NULL,                             &type,                             (UCHAR *)buffer,                             &size);  if(res == ERROR_SUCCESS && type == REG_SZ)    return buffer;  return def;}