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
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); In 8-bit MBCS mode you can declare a wide CString as CString<wchar_t>. 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.
CString cs(L"Hello world"); TCHAR szBuffer[200]; _tcscpy(szBuffer, cs);
Forum Rules