Подскажите что это за ошибка: error LNK2001: unresolved external symbol "protected: virtual struct AFX_MSGMAP const * __thiscall CMainWnd::GetMessageMap(void)const " (?GetMessageMap@CMainWnd@@MBEPBUAFX_MSGMAP@@XZ) Debug/sasa.exe : fatal error LNK1120: 1 unresolved externals Делаю все по книге и выдает ошибку Я только начал изучать Visual C++/MFC Вот код программы:
| Код | #include "afxwin.h" #define IDC_MYBUTTON 100 #define IDC_MYEDIT 102
class CMyButton: public CButton { public: afx_msg void OnLButtonDblClk( UINT, CPoint ); afx_msg void OnRButtonDblClk( UINT, CPoint ); protected: DECLARE_MESSAGE_MAP(); }; void CMyButton::OnLButtonDblClk( UINT, CPoint ) { MoveWindow(CRect(120,100,220,150),TRUE); } void CMyButton::OnRButtonDblClk( UINT, CPoint ) { MoveWindow(CRect(120,10,220,50),TRUE); } BEGIN_MESSAGE_MAP(CMyButton, CButton) ON_WM_LBUTTONDBLCLK() ON_WM_RBUTTONDBLCLK() END_MESSAGE_MAP()
class CMainWnd : public CFrameWnd { public: CMainWnd(); afx_msg void OnLButtonDblClk( UINT, CPoint ); afx_msg void OnRButtonDblClk( UINT, CPoint ); afx_msg void OnKeyDown( UINT, UINT, UINT ); ~CMainWnd(); protected: CStatic* MyStatic; CMyButton* MyButton; CEdit* MyEdit; DECLARE_MESSAGE_MAP();
};
CMainWnd::CMainWnd() { Create(NULL,"Step4",WS_OVERLAPPEDWINDOW,rectDefault, NULL,NULL); MyStatic = new CStatic(); if (MyStatic!=NULL) MyStatic->Create("MyStatic",WS_CHILD|WS_VISIBLE|SS_CENTER, CRect(10,10,100,50),this); MyButton = new CMyButton(); if (MyButton!=NULL) MyButton->Create("MyButton",WS_CHILD|WS_VISIBLE|SS_CENTER, CRect(120,10,220,50),this,IDC_MYBUTTON); MyEdit = new CEdit(); if (MyEdit!=NULL) MyEdit->Create(WS_CHILD|WS_VISIBLE|WS_BORDER, CRect(240,10,340,50),this,IDC_MYEDIT);
}
CMainWnd::~CMainWnd() { if (MyStatic!=NULL) delete MyStatic; if (MyButton!=NULL) delete MyButton; if (MyEdit!=NULL) delete MyEdit; }
class CMyApp : public CWinApp {
public: CMyApp(); virtual BOOL InitInstance(); };
CMyApp::CMyApp() {}
BOOL CMyApp::InitInstance() { m_pMainWnd=new CMainWnd(); ASSERT(m_pMainWnd); m_pMainWnd->ShowWindow(SW_SHOW); m_pMainWnd->UpdateWindow(); return TRUE; };
CMyApp theApp;
|
Спасибо вам большое |