If your project is unicode version,then CString str = _T("fdsfsdfsdf"); str is the unicode string. you can use ATL macro A2W convert this to the unicode one. or you can use MultiByteToWideChar API.
LPCWSTR cwstr=A2CW(str); compile wrong?
//Method one: CString str=_T("TestStr"); USES_CONVERSION; LPWSTR pwStr=new wchar_t[str.GetLength()+1]; wcscpy(pwStr,T2W((LPCTSTR)str)); // Method two: CString str=_T("TestStr"); USES_CONVERSION; LPWCSTR pwcStr = A2CW((LPCSTR)str); Just Browse from Internet,Try this two methods....
you can use ATL macro A2W convert this to the unicode one.
or you can use MultiByteToWideChar API.
compile wrong?
//Method one:
CString str=_T("TestStr");
USES_CONVERSION;
LPWSTR pwStr=new wchar_t[str.GetLength()+1];
wcscpy(pwStr,T2W((LPCTSTR)str)); // Method two:
CString str=_T("TestStr");
USES_CONVERSION;
LPWCSTR pwcStr = A2CW((LPCSTR)str); Just Browse from Internet,Try this two methods....