ptrennum
asked on
How to convert a CString to a LPCWSTR
I have a Cstring and I need to convert it to a LPCWSTR. How can this be done?
PT
PT
ASKER
ok increased points on this one asI'm loooking for a relatively quick response
PT
PT
I'd use
CString strTest = "Test";
wchar_t* pwsz = new wchar_t[strTest.GetLength( ) + 1];
mbstowcs(awc, (LPCTSTR) strTest, strTest.GetLength() + 1);
CString strTest = "Test";
wchar_t* pwsz = new wchar_t[strTest.GetLength(
mbstowcs(awc, (LPCTSTR) strTest, strTest.GetLength() + 1);
ASKER
The problem I'm having is with the privilege code from yesterday. the pwszAccount is asking to be converted from a wchar_t* to a LPTSTR and when I do the conversion i only get the first character back from the original string.
PT
PT
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
You're the man!
Thanks again
PT
Thanks again
PT
Thanx :o)
ASKER
(LPCWSTR)(cstring)