vc++ classwizard "Parsing error:Number or identifier expected.Input line ....."错误解决
2008-08-26 13:53
846 查看
visual c++运行classwizard时,报出如题目所示的错误,点击“确定”,classWizard显示内容为空。
引起这个错误的原因有:
1.消息映射的id与resource.h中的id不匹配;
2.自行添加的消息占用了系统消息的映射位置。
对于第二种错误说明如下:
一个典型的类消息映射具有如下形式(mfc自动生成的代码)
BEGIN_MESSAGE_MAP(CThunderCDlg, CDialog)
//{{AFX_MSG_MAP(CThunderCDlg)
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_BN_CLICKED(IDC_NOPAD_INPUT, OnNopadInput)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
其中橙色虽然为注释代码,但其表明其内区域为系统消息映射部分,classwizard就是依靠这部分说明工作,如果将自定义的消息映射加入了橙色区域,就会出现题目中所述的错误。
正确添加自定义消息映射的位置应该为橙色区域外,但在begin_message_mab与end_message_map之间。
引起这个错误的原因有:
1.消息映射的id与resource.h中的id不匹配;
2.自行添加的消息占用了系统消息的映射位置。
对于第二种错误说明如下:
一个典型的类消息映射具有如下形式(mfc自动生成的代码)
BEGIN_MESSAGE_MAP(CThunderCDlg, CDialog)
//{{AFX_MSG_MAP(CThunderCDlg)
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_BN_CLICKED(IDC_NOPAD_INPUT, OnNopadInput)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
其中橙色虽然为注释代码,但其表明其内区域为系统消息映射部分,classwizard就是依靠这部分说明工作,如果将自定义的消息映射加入了橙色区域,就会出现题目中所述的错误。
正确添加自定义消息映射的位置应该为橙色区域外,但在begin_message_mab与end_message_map之间。
相关文章推荐
- 在VC的MFC的对话框中建立ClassWizard时,提示Parsing error: Expected "=".Input Line:……
- VC++ 6.0 建立类向导(class wizard)错误提示Parsing error: Expected =.Input Line:
- 在VC的MFC的对话框中建立ClassWizard时,提示Parsing error: Expected "=".Input Line:……
- VC建立类向导(class wizard)错误提示Parsing error: Expected =.Input Line:
- VC建立类向导(class wizard)错误提示Parsing error: Expected =.Input Line:
- ASP.NET 页面错误: "asp.net XML Parsing Error: no element found Line Number 1, Column 1"
- IE6,IE7,IE8下报JS错误:expected identifier, string or number的原因及解决办法
- IE6,IE7,IE8下报JS错误:expected identifier, string or number的原因及解决的方法
- IE6,IE7,IE8下报JS错误:expected identifier, string or number的原因及解决办法
- bullet, iOS真机编译错误error: identifier or immediate expression expected解决方法
- VC引入lib库并解决连接错误unresolved external symbol "__declspec(dllimport) const DllClass::`vftable'" (__imp_?
- 报org.apache.axis cannot be resolved to a type且Syntax error on token "enum", class expected错误
- [Caffe]:关于 Error parsing text-format Caffe.NetParameter: xxx.xx : Expected interger or identifier.
- IE7 的JS错误:Expected identifier, string or number
- 基于Web的Kafka管理器工具之Kafka-manager启动时出现Exception in thread "main" java.lang.UnsupportedClassVersionError错误解决办法(图文详解)
- 执行Hive时出现org.apache.hadoop.util.RunJar.main(RunJar.java:136) Caused by: java.lang.NumberFormatException: For input string: "1s"错误的解决办法(图文详解)
- [Caffe]:关于 Error parsing text-format Caffe.NetParameter: xxx.xx : Expected interger or identifier.
- "Interface1.java": 'class' or 'interface' expected at line 19, column 17
- Parsing Error:Expected"afx_msg"解决办法
- 错误:error: expected class-name before '{' token解决方法