How to LPCTSTR Convert to char *
How to LPCTSTR Convert to char *
thank :)
[51 byte] By [
rxgmoral] at [2007-11-11 9:58:30]

# 1 Re: How to LPCTSTR Convert to char *
Hi,
LPCTSTR is just a typedef for const char *.
All you need to do is cast away the const-ness say with const_cast<char*>(...).
Cheers,
D
P.S.: probably I am overly optimistic when I say LPCTSTR is a typedef - might
just be a #define
# 2 Re: How to LPCTSTR Convert to char *
LPCTSTR is a little bit more than just const char *. The T indicates that it's actually a TCHAR pointer which can stand for either char or wchar_t, so you have to be cautious with it. Anyway, if the strings are definitely char strings, not wchar_t strings, const_cast<char *> (pcstr) will do the trick.
Danny at 2007-11-11 21:00:45 >
