LPTSTR
has two modes:
An LPWSTR
if UNICODE
is defined, an LPSTR
otherwise.
#ifdef UNICODE
typedef LPWSTR LPTSTR;
#else
typedef LPSTR LPTSTR;
#endif
or by the other way:
LPTSTR is wchar_t* or char* depending on _UNICODE
if your LPTSTR
is non-unicode:
according to MSDN Full MS-DTYP IDL documentation, LPSTR
is a typedef
of char *
:
typedef char* PSTR, *LPSTR;
so you can try this:
const char *ch = "some chars ...";
LPSTR lpstr = const_cast<LPSTR>(ch);