我在编一个MS_Outlook的效果.
一个很简单的调用还出现这么多编译错误.这是怎么回事儿呢~!
XTOutBarCtrl1.h中的代码:
public:
//视图ID
int m_hfw1 = 1;
int m_hfw2 = 2;
RightPaneFrame* m_pRightPaneFrame;
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CXTOutBarCtrl1)
//}}AFX_VIRTUAL
public:
void SetSelFolder(const int iIndex);
XTOutBarCtrl1.cpp的代码:
//接帘按钮控制函数
void CXTOutBarCtrl1::SetSelFolder(const int iIndex)
{
//调用基类中的函数
CXTOutBarCtrl::SetSelFolder( iIndex); UINT nView = 0;
int hSelectedItem = iIndex; if (hSelectedItem == m_fw1)
nView = VIEW_FORMVIEW1;
else
if (hSelectedItem == m_hfw2)
nView = VIEW_FORMVIEW2; if(nView)
m_pRightPaneFrame->SwitchToView(nView);
}
错误信息是:
ompiling...
MainFrm.cpp
E:\Program Files\Microsoft Visual Studio\MyProjects\adbook\XTOutBarCtrl1.h(29) : error C2258: illegal pure syntax, must be '= 0'
E:\Program Files\Microsoft Visual Studio\MyProjects\adbook\XTOutBarCtrl1.h(29) : error C2252: 'm_hfw1' : pure specifier can only be specified for functions
E:\Program Files\Microsoft Visual Studio\MyProjects\adbook\XTOutBarCtrl1.h(30) : error C2258: illegal pure syntax, must be '= 0'
E:\Program Files\Microsoft Visual Studio\MyProjects\adbook\XTOutBarCtrl1.h(30) : error C2252: 'm_hfw2' : pure specifier can only be specified for functions
XTOutBarCtrl1.cpp
E:\Program Files\Microsoft Visual Studio\MyProjects\adbook\XTOutBarCtrl1.h(29) : error C2258: illegal pure syntax, must be '= 0'
E:\Program Files\Microsoft Visual Studio\MyProjects\adbook\XTOutBarCtrl1.h(29) : error C2252: 'm_hfw1' : pure specifier can only be specified for functions
E:\Program Files\Microsoft Visual Studio\MyProjects\adbook\XTOutBarCtrl1.h(30) : error C2258: illegal pure syntax, must be '= 0'
E:\Program Files\Microsoft Visual Studio\MyProjects\adbook\XTOutBarCtrl1.h(30) : error C2252: 'm_hfw2' : pure specifier can only be specified for functions
E:\Program Files\Microsoft Visual Studio\MyProjects\adbook\XTOutBarCtrl1.cpp(54) : error C2065: 'm_fw1' : undeclared identifier
E:\Program Files\Microsoft Visual Studio\MyProjects\adbook\XTOutBarCtrl1.cpp(57) : error C2065: 'm_hfw2' : undeclared identifier
Generating Code...
Error executing cl.exe.adbook.exe - 10 error(s), 0 warning(s)各位高手帮忙指点一下,这是怎么回事。好像主要就是说int m_hfw1 = 1;
int m_hfw2 = 2;有问题~ 但我看不出什么问题呀。
谢谢了~ :(
一个很简单的调用还出现这么多编译错误.这是怎么回事儿呢~!
XTOutBarCtrl1.h中的代码:
public:
//视图ID
int m_hfw1 = 1;
int m_hfw2 = 2;
RightPaneFrame* m_pRightPaneFrame;
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CXTOutBarCtrl1)
//}}AFX_VIRTUAL
public:
void SetSelFolder(const int iIndex);
XTOutBarCtrl1.cpp的代码:
//接帘按钮控制函数
void CXTOutBarCtrl1::SetSelFolder(const int iIndex)
{
//调用基类中的函数
CXTOutBarCtrl::SetSelFolder( iIndex); UINT nView = 0;
int hSelectedItem = iIndex; if (hSelectedItem == m_fw1)
nView = VIEW_FORMVIEW1;
else
if (hSelectedItem == m_hfw2)
nView = VIEW_FORMVIEW2; if(nView)
m_pRightPaneFrame->SwitchToView(nView);
}
错误信息是:
ompiling...
MainFrm.cpp
E:\Program Files\Microsoft Visual Studio\MyProjects\adbook\XTOutBarCtrl1.h(29) : error C2258: illegal pure syntax, must be '= 0'
E:\Program Files\Microsoft Visual Studio\MyProjects\adbook\XTOutBarCtrl1.h(29) : error C2252: 'm_hfw1' : pure specifier can only be specified for functions
E:\Program Files\Microsoft Visual Studio\MyProjects\adbook\XTOutBarCtrl1.h(30) : error C2258: illegal pure syntax, must be '= 0'
E:\Program Files\Microsoft Visual Studio\MyProjects\adbook\XTOutBarCtrl1.h(30) : error C2252: 'm_hfw2' : pure specifier can only be specified for functions
XTOutBarCtrl1.cpp
E:\Program Files\Microsoft Visual Studio\MyProjects\adbook\XTOutBarCtrl1.h(29) : error C2258: illegal pure syntax, must be '= 0'
E:\Program Files\Microsoft Visual Studio\MyProjects\adbook\XTOutBarCtrl1.h(29) : error C2252: 'm_hfw1' : pure specifier can only be specified for functions
E:\Program Files\Microsoft Visual Studio\MyProjects\adbook\XTOutBarCtrl1.h(30) : error C2258: illegal pure syntax, must be '= 0'
E:\Program Files\Microsoft Visual Studio\MyProjects\adbook\XTOutBarCtrl1.h(30) : error C2252: 'm_hfw2' : pure specifier can only be specified for functions
E:\Program Files\Microsoft Visual Studio\MyProjects\adbook\XTOutBarCtrl1.cpp(54) : error C2065: 'm_fw1' : undeclared identifier
E:\Program Files\Microsoft Visual Studio\MyProjects\adbook\XTOutBarCtrl1.cpp(57) : error C2065: 'm_hfw2' : undeclared identifier
Generating Code...
Error executing cl.exe.adbook.exe - 10 error(s), 0 warning(s)各位高手帮忙指点一下,这是怎么回事。好像主要就是说int m_hfw1 = 1;
int m_hfw2 = 2;有问题~ 但我看不出什么问题呀。
谢谢了~ :(
解决方案 »
- 关于全屏窗口的疑惑
- 二叉树遍历失败、、、就是改不出来,我是用mfc做的,建树错了,判断的错了,调用???
- 在vs2005里有没象vc6.0一样的向导?
- 怎么使用"打开文件对话框":CFileDialog?内容见内
- 为什么我在lib里创建线程时传递参数会出问题?
- CSocket和CAsyncSocket类的区别是什么?非阻塞和异步是相同的概念吗?
- 有谁知道ftp的"425 Can't open data connection."是什么原因?〔急)
- help me!
- 日期为变量,sqlite按日期查询
- 关于VC++头文件的问题,30分送上!!
- 我的VC6.0按"."时有时能出提示,有时点不出提示,程序没错的
- MM的问题
int m_hfw1;
int m_hfw2;在XTOutBarCtrl1.CPP的构造函数中:m_hfw1=1;
m_hfw2=2;