title: std::string to LPBYTE and RegEnumValueA
body: <p>What is the proper way to cast std::string to LPBYTE to make this code work?</p>
  
  <pre><code>string Name;
  string Value;
  RegEnumValueA(hKey, 0, const_cast&lt;char*&gt;(Name.c_str()), &amp;dwSize, NULL, NULL, (LPBYTE)const_cast&lt;char*&gt;(Value.c_str()), &amp;dwSize2);
  </code></pre>
  
  <p>When I try to user this code everythins is okey with the string name, but there's a bad pointer error in the string value</p>