API Win32 LPCWSTR ( NULL- C- wchar_t).
API, SetWindowTextA (HWND, LPCSTR) SetWindowTextW (HWND, LPCWSTR), SetWindowText() UNICODE , :
#ifdef UNICODE
#define SetWindowText SetWindowTextW
#else
#define SetWindowText SetWindowTextA
#endif
API SetWindowTextA() LPCWSTR LPCSTR SetWindowTextW(), , UNICODE wchar_t .
COM- BSTR, , .
, BSTR LPCWSTR MS _bstr_t class: _bstr_t myBstr (/LPCWSTR/psText).
ATL:: CString MFC CString ( ) CStringA CStringW. ( CStringA:: LPCSTR() CStringW:: operator LPCWSTR()), CString API Win32:
CString myStr = _T("Hello");
::SetWindowText(myHwnd, myStr);
std:: [w] , c_str(), :
std::wstring myStr = L"Hello"; // assuming UNICODE defined
::SetWindowText(myHwnd, myStr.c_str());
:
UNICODE , Win32.
- MFC, , , CString, ATL , ATL:: CString,
(#include <atlstr.h> ATL) std:: wstring. - , std:: wstring.