-
June 20th, 2001, 01:52 PM
#1
Conversion: CString to PCWSTR
How do I convert a CString to a PCWSTR?
Thanks.
-
June 20th, 2001, 02:07 PM
#2
Re: Conversion: CString to PCWSTR
CString str;
USES_CONVERSION;
PCWSTR psz = T2CW(str);
Make sure to include <afxconv.h> in your stdafx.h file.
-
June 20th, 2001, 02:15 PM
#3
Re: Conversion: CString to PCWSTR
Hi !
Try that code:
CString str = "lalala";
#ifdef _UNICODE
PCWSTR p = LPCTSTR(str);
#else
USES_CONVERSION;
PCWSTR p = A2CW(LPCTSTR(str));
#endif
rate it if ... blah-lah-lah
Best regards,
-----------
Igor Soukhov (Brainbench/Tekmetrics ID:50759)
igor_soukhov@yahoo.com | ICQ:57404554 | http://siv.da.ru
-
June 20th, 2001, 02:18 PM
#4
Re: Conversion: CString to PCWSTR
It is worth to note that
#ifdef _UNICODE
PCWSTR p = LPCTSTR(str);
#else
USES_CONVERSION;
PCWSTR p = A2CW(LPCTSTR(str));
#endif
is exactly how T2CW macro works.
-
June 20th, 2001, 02:54 PM
#5
Re: Conversion: CString to PCWSTR
Cool ! =)
Best regards,
-----------
Igor Soukhov (Brainbench/Tekmetrics ID:50759)
igor_soukhov@yahoo.com | ICQ:57404554 | http://siv.da.ru
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|