출처 : http://blog.naver.com/melugi/80105665180
에러메시지
MFC 환경을 유니코드로 설정했을때 나타나게 되는 메시지이다
error C2664: 'void ATL::CStringT<BaseType,StringTraits>::Format(const wchar_t *,...)' : 매개 변수 1을(를) 'const char [11]'에서 'const wchar_t *'(으)로 변환할 수 없습니다.
with
[
BaseType=wchar_t,
StringTraits=StrTraitMFC_DLL<wchar_t>
]
가리킨 형식이 관련이 없습니다. 변환하려면 reinterpret_cast, C 스타일 캐스트 또는 함수 스타일 캐스트가 필요합니다.
대처법
기존의 코드
CString str;
str.Format("%c", ch);
다음과 같이 _T()로 감싸준다
CString str;
str.Format(_T("%c"), ch);
'Programming > MFC' 카테고리의 다른 글
런타임 라이브러리 (Run-time Libraries) (0) | 2017.07.03 |
---|---|
CFile Class (0) | 2017.06.28 |
충격 AfxGetMainWnd() 함수 (0) | 2016.11.21 |
error C2661: 'pcl::PointCloud<PointT>::operator new' : no overloaded function takes 3 arguments (0) | 2016.11.17 |
error C3859: PCH에 대한 가상 메모리 범위를 초과했습니다.에러 (0) | 2016.11.16 |