Module/WindowsMFC

CString <-> wchar_t *

퓨림노 2008. 12. 12. 02:48

 // CString -> wchar_t *  -_-;;;;;   이상함..;;
 CStringW aaa(_T("hello!"));
 wchar_t *a = (wchar_t *)aaa.GetBuffer();
 MessageBoxW(NULL, a, a, 0);

//이것도....  되긴되는데..;;;;
 wchar_t wTemp[1024] = L"\0";
 MultiByteToWideChar(CP_ACP, 0, m_szNotice,m_szNotice.GetLength(),wTemp,1024);

 
 // wchar_t *  -> CString 변환
 wchar_t *aaa = L"Hello, World!";
 CString temp(aaa);  
 m_szText = temp;