title: How can I read a key value of Registry and print it to the screen with the MessageBox()
body: <p>I'm new to C++ and to WinCe developing.</p>
  
  <p>I want to read a string from the registry and display with the <code>MessageBox()</code>. I have tried the following.</p>
  
  <pre><code>HKEY key;
  if (::RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("System\\CurrentControlSet\\GPS Intermediate Driver\\Drivers\\SiRFStar3HW"), 0, KEY_READ, &amp;key) != ERROR_SUCCESS)
  {
      MessageBox(NULL,L"Can't open the registry!",L"Error",MB_OK);
  }
  char value[5];
  DWORD value_length=5;
  DWORD type=REG_SZ;
  RegQueryValueEx(key,(LPCTSTR)"Baud", NULL, &amp;type, (LPBYTE)&amp;value, &amp;value_length);
  wchar_t buffer[5];
  _stprintf(buffer, _T("%i"), value);
  
  ::MessageBox(NULL,buffer,L"Value:",MB_OK);
  
  ::RegCloseKey(key);
  </code></pre>
  
  <p>So I know somethings wrong in here, but how can I solve?</p>