现在的位置: 首页 > 综合 > 正文

用本5年前的dotnet书学习vs2005下的c++,步履维艰

2013年12月05日 ⁄ 综合 ⁄ 共 651字 ⁄ 字号 评论关闭
 VS2005中AfxMessageBox()使用注意

VS2005编译器的检查更严格了,在vc6vc7种可以编译通过的语句:AfxMessageBox(“test”);只能写成AfxMessageBox(_T(“test”));才能使用,否则编译器会告诉你有两个AfxMessageBox函数,但编译器不知道使用哪一个。错误提示如下:

         error C2665: 'AfxMessageBox' : none of the 2 overloads could convert all the argument types

        c:/program files/microsoft visual studio 8/vc/atlmfc/include/afxwin.h(5025): could be 'int AfxMessageBox(LPCTSTR,UINT,UINT)'

        c:/program files/microsoft visual studio 8/vc/atlmfc/include/afxwin.h(5027): or 'int AfxMessageBox(UINT,UINT,UINT)'

        while trying to match the argument list '(const char [22])'

抱歉!评论已关闭.