FAQ: Cannot convert from 'const char [..]' to 'LPCTSTR'
- FAQ: Cannot convert from 'const char [..]' to 'LPCTSTR'
- How to convert string to LPCTSTR?
- Convert char * to wchar*
- “c++ convert const char* to LPCWSTR” Code Answer
- All C++ Answers
- Converting 'const char*' to 'LPCTSTR' for CreateDirectory
- cannot convert from 'const char *' to 'LPCTSTR'
Resolution
You will have to do one of two things:
1. Change your project configuration to use multibyte strings. Press ALT+F7 to open the properties, and navigate to Configuration Properties > General. Switch Character Set to "Use Multi-Byte Character Set".
2. Indicate that the string literal, in this case "Hello world!" is of a specific encoding. This can be done through either prefixing it with L, such as L"Hello world!", or surrounding it with the generic _T("Hello world!") macro. The latter will expand to the L prefix if you are compiling for unicode (see #1), and nothing (indicating multi-byte) otherwise.
good website for developer: codegrepper.com
good website for developer: codegrepper.com
No comments:
Post a Comment