请问这样添加消息映射为什么出错?
我的步骤如下:
新建一个单文档项目,在StringTable里添加一个ID_TEST
在CView.h里边添加
protected:
//{{AFX_MSG(CEx06DView)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
afx_msg void OnTest(CCmdUI* pCmdUI); //我写的
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
在CView.cpp里面添加
BEGIN_MESSAGE_MAP(CEx06DView, CView)
//{{AFX_MSG_MAP(CEx06DView)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG_MAP
ON_UPDATE_COMMAND_UI(ID_TEST,OnTest) //我写的
END_MESSAGE_MAP()
编译后报错信息如下:
error LNK2001: unresolved external symbol "protected: void __thiscall CEx06DView::OnTest(class CCmdUI *)" (?OnTest@CEx06DView@@IAEXPAVCCmdUI@@@Z)
Debug/Ex06D.exe : fatal error LNK1120: 1 unresolved externals
请问应该怎样手工添加消息映射啊?