How to convert const char* to const WCHAR*. 2. Converting 'const char*' to 'LPCTSTR' for CreateDirectory. 2. C++ - how to convert between types that are only known at runtime.
LPCTSTR is either defined as a const wchar_t * or a const char * depending on whether your project defined the preprocessor symbol UNICODE (or _UNICODE, I forget which one MFC uses).
How do I convert from CString to const char* in my Unicode MFC application?
How do I make this conversion? The next step is to set today's date as a string or char and concatenate it with the filepath.
To convert a const char * to an LPCTSTR type, add L before the const char *, as per se
There exist set of conversion routine to convert MBCS to Unicode and vice versa, which I would explain soon.
All that is left to do is use AnsiToOem() but i get the cannot convert from 'const char *' to 'LPCTSTR', i know that LPCTSTR is a windows 4 byte, so my question is there a way ?
Re: CString to const char*. Originally Posted by Paul McKenzie. Use the LPCTSTR() conversion operator for CString.
error C2664: 'CWnd::MessageBoxW' : cannot convert parameter 1 from 'const char ' to 'LPCTSTR'.
How to LPCTSTR Convert to char * DaniWeb LPCTSTR is defined as const char *.