简单的消息映射实现错误怎么改
#include<afxwin.h>class MyWnd:public CFrameWnd
{
private:
char *ShowText;//声明一个字符串为数据成员
public:
afx_msg void OnPaint();//声明WM_PAINT消息处理函数
afx_msg void OnLButtonDown();//鼠标按下消息处理函数
DECRARE_MESSAGE_MAP(); //声明消息映射
};
//消息映射的实现
BEGIN_MESSAGE_MAP(MyWnd,CFrameWnd)
ON_WM_PAINT()
ON_WM_LBUTTONDOWN()
END_MESSAGE_MAP()
void MyWnd::OnPaint()
{
CPaintDC dc(this);
dc.TextOut(20,20,ShowText);
}
void MyWnd::OnLButtonDown()
{
ShowText="windows编程框架"; //当鼠标按下左键时输出字符串
InvalidateRect(NULL,TRUE); //通知更新
}
class CMyApp:public CWinApp
{
public:
BOOL InitInstance();
};
BOOL CMyApp::InitInstance()
{
MyWnd *pMainWnd=new MyWnd;
pMainWnd->Create(0,"windows编程");
pMainWnd->ShowWindow(m_nCmdShow);
pMainWnd->UpdateWindow();
m_pMainWnd=pMainWnd;
return TRUE;
}
CMyApp MyApp;
error C2509: 'GetMessageMap' : member function not declared in 'MyWnd'
请问应该怎么改?