CString CHOOL_FIVEDlg :: formatsend ( int x , int y ){
CString outbuf = "POS" ,strtemp ;
wchar_t s ;
s = 'a'+ x ;
strtemp.Format ( "%c",s ) ;
outbuf += strtemp ;
s = 'o' + y ;
strtemp.Format ( "%c",s ) ;
outbuf += strtemp ;
return outbuf ;
}
错误:
d:\my documents\visual studio 2005\projects\hool_five\hool_five\hool_fivedlg.cpp(479) : error C2440: “=”: 无法从“int”转换为“wchar_t *”
从整型转换为指针类型要求 reinterpret_cast、C 样式转换或函数样式转换
d:\my documents\visual studio 2005\projects\hool_five\hool_five\hool_fivedlg.cpp(481) : error C2664: “void ATL::CStringT<BaseType,StringTraits>::Format(const wchar_t *,...)”: 不能将参数 1 从“const char [3]”转换为“const wchar_t *”
with
[
BaseType=wchar_t,
StringTraits=StrTraitMFC_DLL<wchar_t>
]
与指向的类型无关;转换要求 reinterpret_cast、C 样式转换或函数样式转换
d:\my documents\visual studio 2005\projects\hool_five\hool_five\hool_fivedlg.cpp(485) : error C2440: “=”: 无法从“int”转换为“wchar_t *”
从整型转换为指针类型要求 reinterpret_cast、C 样式转换或函数样式转换
d:\my documents\visual studio 2005\projects\hool_five\hool_five\hool_fivedlg.cpp(487) : error C2664: “void ATL::CStringT<BaseType,StringTraits>::Format(const wchar_t *,...)”: 不能将参数 1 从“const char [3]”转换为“const wchar_t *”
with
[
BaseType=wchar_t,
StringTraits=StrTraitMFC_DLL<wchar_t>
]
与指向的类型无关;转换要求 reinterpret_cast、C 样式转换或函数样式转换
麻烦大家帮我找出问题来,谢谢!到底杂回事儿,有够郁闷,Format到底杂用? :(