How can I convert a
LPCSTR? Also, how can I convert a
I am totally confused with these
LPCWSTR the same?
str.c_str() gives you a
const char *, which is an
LPCSTR (Long Pointer to Constant STRing) -- means that it's a pointer to a
0 terminated string of characters.
W means wide string (composed of
wchar_t instead of
c_str() to get a
const char * (
LPCSTR) from a
It's all in the name:
LPSTR - (long) pointer to string -
LPCSTR - (long) pointer to constant string -
const char *
LPWSTR - (long) pointer to Unicode (wide) string -
LPCWSTR - (long) pointer to constant Unicode (wide) string -
const wchar_t *
LPTSTR - (long) pointer to TCHAR (Unicode if UNICODE is defined, ANSI if not) string -
LPCTSTR - (long) pointer to constant TCHAR string -
const TCHAR *
You can ignore the L (long) part of the names -- it's a holdover from 16-bit Windows.