string--->CString

#ifdef UNICODE
#define Tstring wstring
#else
#define Tstring string
#endif

可以这样转换
CString str=CString(string.c_str())

 

const char*----->LPCWSTR

const char *str;
CString temp = str;
LPCWSTR app = (LPCWSTR)(temp.AllocSysString());

 

wstring  ----->LPCWSTR

wstring stemp;

LPCWSTR result = stemp.c_str();

 

posted on 2014-10-14 21:45  逸枫_1987  阅读(126)  评论(0编辑  收藏  举报