You can't just do a cast --- it won't work.
windows can encode strings in Unicode using wide characters wchar_t (ie. using two bytes), but they
can also use ordinary char type.
wchar_t* is a string encoded in UTF-16
char* is a ASCII string
They aren't compatible.
If you go to
MSDN site, you'll see LPC
TSTR or LP
TSTR everywhere as a string types. Those can
be either wchar_t* or char* depending on whether _UNICODE macro is defined. Types with "W"
inside use Unicode only.
To make programmers' lifes easier (?) M$ instoduced a set of macros, which change their meaning
whether you compile you program as Unicode enabled or not. LPCTSTR is one of them. Others are
_T, _TEXT, _TCHAR,...
Read this.