StrToIntEx

The Win32 API StrToIntEx requires a string to be prefixed with '0x' when using STIF_SUPPORT_HEX. Here is a replacement function you can use instead if you want to convert a hex string to binary and your string does not have that prefix.

unsigned HexToInt(TCHAR *p)
{
   unsigned v = 0;

   while (*p)
   {
      if (*p >= '0' && *p < = '9')
      {
         v<<=4;
         v += *p - '0';
      }
      else if (*p >= 'A' && *p < = 'F')
      {
         v<<=4;
         v += *p - 'A' + 10;
      }
      else
         break;
      p++;
   }
   return v;
}