Search This Blog

Thursday, January 1, 2009

error C2664: 'void ATL::CStringT::Format(const wchar_t *,...)' : cannot convert parameter 1 from 'const char [3]' to 'const wc

If you are getting following error:
error C2664: 'void ATL::CStringT::Format(const wchar_t *,...)' : cannot convert parameter 1 from 'const char [3]' to 'const wchar_t *'

Solution1:
In Project Menu select your Project Properties.

In Configuration Properties
Set "Character Set" as "Use Multi-Byte Character Set"

Solution2:
where ever you are declaring "CString" variable add Unicode support.
Example:
CString csStr(_T("")); //_T("") is for unicode support


No comments: