“AfxMessageBox”: 2 个重载中没有一个可以转换所有参数类型,该怎么解决
“AfxMessageBox”: 2 个重载中没有一个可以转换所有参数类型
各位大侠,我遇到这样的问题
我使用AfxMessageBox("CreatePen Error!!");
这个语句时,编译器提示“AfxMessageBox”: 2 个重载中没有一个可以转换所有参数类型。】
d:\my documents\visual studio 2005\projects\mfc\mfc\mfcview.cpp(119) : error C2665: “AfxMessageBox”: 2 个重载中没有一个可以转换所有参数类型
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxwin.h(5025): 可能是“int AfxMessageBox(LPCTSTR,UINT,UINT)”
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxwin.h(5027): 或“int AfxMessageBox(UINT,UINT,UINT)”
试图匹配参数列表“(const char [18])”时
------解决思路----------------------
AfxMessageBox(_T("CreatePen Error!!"));
------解决思路----------------------
这应该编译能通过吧
可能是你打字输入法用的全角。
------解决思路----------------------
1楼是对的,可能你的工程是UNICODE字符集,所以就出错了,加上_T后就自动转换成UNICODE字符集了
各位大侠,我遇到这样的问题
我使用AfxMessageBox("CreatePen Error!!");
这个语句时,编译器提示“AfxMessageBox”: 2 个重载中没有一个可以转换所有参数类型。】
d:\my documents\visual studio 2005\projects\mfc\mfc\mfcview.cpp(119) : error C2665: “AfxMessageBox”: 2 个重载中没有一个可以转换所有参数类型
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxwin.h(5025): 可能是“int AfxMessageBox(LPCTSTR,UINT,UINT)”
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxwin.h(5027): 或“int AfxMessageBox(UINT,UINT,UINT)”
试图匹配参数列表“(const char [18])”时
------解决思路----------------------
AfxMessageBox(_T("CreatePen Error!!"));
------解决思路----------------------
这应该编译能通过吧
可能是你打字输入法用的全角。
------解决思路----------------------
1楼是对的,可能你的工程是UNICODE字符集,所以就出错了,加上_T后就自动转换成UNICODE字符集了