我在编一个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;有问题~   但我看不出什么问题呀。
谢谢了~ :(