公告
财富商城
积分规则
提问
发文
2020-07-17 16:23发布
该账号已被封号
How to convert string to TCHAR* in VC++ ?
Thanks.
#include <atlstr.h> String dir="hello world"; char * data = new char[dir.size() + 1]; copy(dir.begin(), dir.end(), data); data[dir.size()] = '\0'; USES_CONVERSION; TCHAR* directory = A2T(data);
If your project is Unicode, you need MultiByteToWideChar. Otherwise, just use str.c_str();
MultiByteToWideChar
str.c_str();
I resolved it using (TCHAR*)str.c_str()
(TCHAR*)str.c_str()
最多设置5个标签!
If your project is Unicode, you need
MultiByteToWideChar
. Otherwise, just usestr.c_str();
I resolved it using
(TCHAR*)str.c_str()