title: Covert String to LPVOID and LPCWSTR in C++
body: <p>I’m working with the winHTTP API in c++ and I have started to write a wrapper class for my application. For simplicity I have a number of functions that can take string parameters and use them in the winHTTP calls. However many of these require the data to be LPVOID or LPCWSTR. I can make it all work by making my wrapper functions take LPVOID or LPCWSTR parameters, but I would prefer string parameters. So is there any way to covert from sting to LPVOID/ LPCWSTR?</p>
  
  <p>My attempts (below) just produced jibberish</p>
  
  <pre><code>bool httpWrapper::setPostData(const string &amp;postData){
  
   _postData = (LPVOID)postData.c_str();
  
   _postData_len = 47;
  
   return false;
  }
  </code></pre>
  
  <p>Any help would be much appreciated</p>
  
  <p>Thanks</p>