‘CString’에서 ‘const char *'(으)로 변환할 수 없습니다.

아래 소스의 경우 Unicode로 프로그램할 경우 발생하는 에러입니다.

char *pszText = new char[m_strText.GetLength() + 1];
strcpy(pszText, m_strText);

이 경우 char==>TCHAR, strcpy==>_tcspy로 변경하여 사용하시기 바랍니다.

수정한 소스는 아래와 같습니다.

TCHAR *pszText = new TCHAR[m_strText.GetLength() + 1];
wcscpy_s(pszText, m_strText.GetLength() + 1, m_strText);

Leave a Comment