我用的是vc++6.0,这个工程是一个主窗口,通过一个控件调用一个叫IDD_ADD窗口,在IDD_ADD窗口中我创建了类CAddDialog,编译的时候IDD_ADD窗口代码里面报错,错误信息如下:
d:\学习\vc++\lhwy\adddialog.h(21) : error C2065: 'IDD_ADD' : undeclared identifier
d:\学习\vc++\lhwy\adddialog.h(21) : error C2057: expected constant expression
lhwy.cpp
d:\学习\vc++\lhwy\adddialog.h(21) : error C2065: 'IDD_ADD' : undeclared identifier
d:\学习\vc++\lhwy\adddialog.h(21) : error C2057: expected constant expression
lhwyDoc.cpp
d:\学习\vc++\lhwy\adddialog.h(21) : error C2065: 'IDD_ADD' : undeclared identifier
d:\学习\vc++\lhwy\adddialog.h(21) : error C2057: expected constant expression
lhwySet.cpp
d:\学习\vc++\lhwy\adddialog.h(21) : error C2065: 'IDD_ADD' : undeclared identifier
d:\学习\vc++\lhwy\adddialog.h(21) : error C2057: expected constant expression
lhwyView.cpp
d:\学习\vc++\lhwy\adddialog.h(21) : error C2065: 'IDD_ADD' : undeclared identifier
d:\学习\vc++\lhwy\adddialog.h(21) : error C2057: expected constant expression
错误信息指向代码:
public:
CAddDialog(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CAddDialog)
enum { IDD = IDD_ADD };报错行
CButton m_Ok;
CButton m_Cancel;
long m_English;
long m_Maths;
CString m_strName;
long m_Xuehao;
//}}AFX_DATA
到底是什么地方出错?我用的是MFC向导。请教,静候佳音!
[此贴子已经被作者于2006-3-30 15:05:05编辑过]