您的位置:首页 > 其它

深入浅出MFC 例子运行错误

2011-08-14 22:27 495 查看
错误信息:

Compiling...

mfc.cpp

D:\61\mfc7\mfc.cpp(61) : error C2101: '&' on constant

D:\61\mfc7\mfc.cpp(65) : error C2101: '&' on constant

D:\61\mfc7\mfc.cpp(69) : error C2101: '&' on constant

D:\61\mfc7\mfc.cpp(73) : error C2101: '&' on constant

D:\61\mfc7\mfc.cpp(77) : error C2101: '&' on constant

my.cpp

D:\61\mfc7\my.cpp(18) : error C2101: '&' on constant

D:\61\mfc7\my.cpp(22) : error C2101: '&' on constant

D:\61\mfc7\my.cpp(26) : error C2101: '&' on constant

D:\61\mfc7\my.cpp(30) : error C2101: '&' on constant

D:\61\mfc7\my.cpp(55) : warning C4018: '==' : signed/unsigned mismatch

Error executing cl.exe.

mfc7.exe - 9 error(s), 1 warning(s)

错误原因:

VC 6、5消息映射有不同。

1)

修改 头文件 Afxmsg_.h 中

#define ON_COMMAND(id, memberFxn) \

{ WM_COMMAND, CN_COMMAND, (WORD)id, (WORD)id, AfxSig_vv, (AFX_PMSG)memberFxn },

改 CN_COMMAND为 0

并且

2)

修改 头文件mfc.h中

// Message map signature values and macros in separate header

#include <afxmsg_.h>



// Message map signature values and macros in separate header

#include "afxmsg_.h"

rebuild all
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐