问题描述
本人用Microsoft Visual Studio编写MFC代码
在使用函数AfxMessageBox( )是发生错误:
AfxMessageBox("GetDIBits");
编译器显示的错误为:
error C2665: ‘AfxMessageBox’ : none of the 2 overloads could convert all the argument types
重载时有两种参数,但编译器不知道该用哪一种
解决方案
将代码写成AfxMessageBox(_T(“XXX”)) 的形式进行使用
AfxMessageBox(_T("GetDIBits"));
修改后,编译成功。