请教怎么从 WCHAR 转换到 LPCTSTR
请问如何从 WCHAR 转换到 LPCTSTR ?
如题
请问如何从 WCHAR 转换到 LPCTSTR ?
谢谢!
------解决方案--------------------
lstrcpy
------解决方案--------------------
WCHAR ch = 'a ';
CString str( ch );
LPCTSTR lpctstr = str;
------解决方案--------------------
这2种类型直接赋值都可以,可能有点不安全而已,转换的方式太多
提供一种参考:
WCHAR cc[] = _T( "中国fdafd ");
LPCTSTR str;
//str = cc;
USES_CONVERSION;
str = W2CT(cc);
------解决方案--------------------
楼上的,W22T 用于 WCHAR* 转换成 LPCTSTR,不是 WCHAR 转换成 LPCTSTR...
如题
请问如何从 WCHAR 转换到 LPCTSTR ?
谢谢!
------解决方案--------------------
lstrcpy
------解决方案--------------------
WCHAR ch = 'a ';
CString str( ch );
LPCTSTR lpctstr = str;
------解决方案--------------------
这2种类型直接赋值都可以,可能有点不安全而已,转换的方式太多
提供一种参考:
WCHAR cc[] = _T( "中国fdafd ");
LPCTSTR str;
//str = cc;
USES_CONVERSION;
str = W2CT(cc);
------解决方案--------------------
楼上的,W22T 用于 WCHAR* 转换成 LPCTSTR,不是 WCHAR 转换成 LPCTSTR...