深入浅出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
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
相关文章推荐
- 解决 “VC++ 多线程编程,win32,MFC 例子(转)”在高版本上运行有错误的问题
- error C3861: 'CoInitializeEx': identifier not found (DirectShow SDK 例子运行错误信息解决)
- 解决MFC运行时错误:“Stack around the variable 'dlg' was corrupted. ”
- spark例子SimpleApp运行错误
- MFC第一个例子 -- windows程序运行原理
- 一个range函数理解错误导致程序运行不正确的例子
- 解决MFC运行时错误:“Stack around the variable 'dlg' was corrupted. ”
- VS2008编译的mfc程序在没有安装的机子上运行出现配置错误的问题
- vs2010创建Dll例子,并解决运行错误:应用程序正常初始化(0xc000000d)失败。请单击“确定”,终止应用程序。
- fvcom inlet例子的运行(错误)
- VC6工程迁移到VC2008 SP1中,使用MFC 9.0静态链接后运行错误的解决办法
- 在Ubuntu下安装tinyos详细教程以及运行TestSerial例子出现错误解决办法
- 日常查错---编写websocket例子运行错误
- 在运行jPCT的第一个例子HelloWorld-AE时碰到错误的解决办法
- MFC:“Debug Assertion Failed!” ——自动生成的单文档程序项目编译运行就有错误
- 高通AR_SDK_Vuforia例子: Dominoes等例子运行错误问题
- C/C++/MFC 编译运行错误解决方法收集error
- qt例子不能运行,qt编译错误,qmake不能呢运行;error while building deploying解决
- cuda的julia集运行错误解决办法- 《cuda by examples》第四章例子
- 深入浅出MFC学习笔记:MFC六大关键技术仿真之RTTI运行时类型识别