| CodeGuru Home | VC++ / MFC / C++ | .NET / C# | Visual Basic | Newsletters | VB Forums | Developer.com |
|
|||||||
| Visual C++ Programming Ask questions about Windows programming with Visual C++ and help others by answering their questions. |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
convert CString to const wchar_t *.
Hi all please tell me how can i convert CString to const wchar_t *.
thanks.
__________________
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH |
|
#2
|
|||
|
|||
|
Re: convert CString to const wchar_t *.
If you compile in Unicode mode, your CStrings will be wide, and you can use the standard cast operator:
Code:
CString cs(L"Hello world"); TCHAR szBuffer[200]; _tcscpy(szBuffer, cs); If you have an 8-bit CString you can use the conversion macros USES_CONVERSION and A2W() to convert the contents to wide characters. Or use a _bstr_t variable, which is a dual-mode string. |
![]() |
| Bookmarks |
|
||||||
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|