偶仿照一本VC书上键入如下简单代码,但编译时总是出现链接错误!
人菜,没办法!-_-
各位大侠,请不吝赐教!
多谢了!
[CODE]
// MyApp.h// the class of application
class CMyApp : public CWinApp
{
public:
virtual BOOL InitInstance();
};// the class of frame window
class CMyFrame : public CFrameWnd
{
public:
CMyFrame();

protected:
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnPaint();
DECLARE_MESSAGE_MAP();
};// MyApp.cpp#include <afxwin.h> // 声明基类的文件库头文件
#include "MyApp.h"CMyApp NEAR theApp; // the object of the class of CMyAppBOOL CMyApp::InitInstance()
{
m_pMainWnd = new CMyFrame();
m_pMainWnd->ShowWindow(m_nCmdShow);
m_pMainWnd->UpdateWindow(); return TRUE;
}BEGIN_MESSAGE_MAP(CMyFrame, CFrameWnd)
ON_WM_LBUTTONDOWN()
ON_WM_PAINT()
END_MESSAGE_MAP()CMyFrame::CMyFrame()
{
Create("AfxFrameOrVIEW", "MYAPP Application");
}void CMyFrame::OnLButtonDown(UINT nFlags, CPoint point)
{
TRACE("Entering CMyFrame::OnLButtonDown - %lx, %d, %d\n", (long)nFlags, point.x, point.y);
}void CMyFrame::OnPaint()
{
CPaintDC dc(this);
dc.TextOut(0, 0, "Hello, World!");
}
[/CODE]