title: retrieving string from LPVOID
body: <p>Can someone explain and help me out here please.
  Lets say i have function like this where lpData holds a pointer to the data i want. </p>
  
  <pre><code>void foo(LPVOID lpData) {
  
  }
  </code></pre>
  
  <p>What is the proper way to retreive this. This works but i get weird characters at the end</p>
  
  <pre><code>void foo(LPVOID lpData) {
      LPVOID *lpDataP = (LPVOID *)lpData;
  char *charData = (char*)lpDataP;
      //i log charData....
  }
  </code></pre>
  
  <p>I would prefer to use strings but I don't understand how to retrieve the data, i just get null pointer error when i try to use string. lpData holds a pointer right? (But my function is lpData not *lpData) so it isn't working? Am i doing this all wrong?</p>
  
  <pre><code>string *datastring = reinterpret_cast&lt;std::string *&gt;(lpData);
  </code></pre>
  
  <p>is what im trying.</p>