title: How to convert std::wstring to LPCTSTR in C++?
body: <p>I have Windows registry key value in <code>wstring</code> format. Now I want to pass it to this code (first argument - path to javaw.exe):</p>
  
  <pre><code>std::wstring somePath(L"....\\bin\\javaw.exe");
  
      if (!CreateProcess("C:\\Program Files\\Java\\jre7\\bin\\javaw.exe", &lt;--- here should be LPCTSTR, but I have a somePath in wstring format..
              cmdline, // Command line.
              NULL, // Process handle not inheritable.
              NULL, // Thread handle not inheritable.
              0, // Set handle inheritance to FALSE.
              CREATE_NO_WINDOW, // ON VISTA/WIN7, THIS CREATES NO WINDOW
              NULL, // Use parent's environment block.
              NULL, // Use parent's starting directory.
              &amp;si, // Pointer to STARTUPINFO structure.
              &amp;pi)) // Pointer to PROCESS_INFORMATION structure.
      {
          printf("CreateProcess failed\n");
          return 0;
      }
  </code></pre>
  
  <p>How can I do that?</p>