Can't convert Char to LPWSTR
<p>The following code </p>

<pre><code>string exePath() {
string path;
char buffer[MAX_PATH];
cout &lt;&lt; "reading path\n";
GetModuleFileName(NULL, buffer, MAX_PATH);
string::size_type pos = string(buffer).find_last_of("\\/");
path = string(buffer).substr(0, pos)/*+"\\system.exe"*/;
return path;
</code></pre>

<p>}</p>

<p>gives me error at the second parameter in VisualStudio (buffer):</p>

<blockquote>
  <p>the type "char *" argument is incompatible with the type parameter
  "LPWSTR"</p>
</blockquote>

<p>(translated from italian,i have vs in italian, hope you understand)
and
can't convert Char to LPWSTR in the 2 argument</p>

<p>This code compiles fine with code::blocks and dev c++ but in vs it doesn't</p>