[VC++] 문자열변환 CString LPSTR WCHAR* LPCWSTR
VC++의 문자열 변환중 CString에 관련된 몇가지를 알아보자. CString LPSTR WCHAR* LPCWSTR CString to LPSTR CollapseCString str = _T("My String"); int nLen = str.GetLength(); LPTSTR lpszBuf = str.GetBuffer(nLen); // here do something with lpszBuf........... str.ReleaseBuffer(); LPTSTR to LPWSTR int nLen = MultiByteToWideChar(CP_ACP, 0, lptStr, -1, NULL, NULL); MultiByteToWideChar(CP_ACP, 0, lptStr, -1, lpwStr, nLen); C..
2010. 9. 10.