VC++ 6.0 编译错误请教
编译出现如下错误,请各位高人指教,先谢谢了!w.h
#include <afxwin.h>
class CMyApp:public CWinapp
{
public:
virtual BOOL InitInstance();
};
class CMainWnd:public CFrameWnd
{
protected:
int x1,x2,y1,y2;
afx_msg void OnLButtonDown(UINT nFlags,CPoint point);
public:
CMainWnd();
~CMainWnd();
DECLARE_MESSAGE_MAP();
};
chen.cpp
#include <w.h>
BEGIN_MESSAGE_MAP(CMainWnd,CFrameWnd)
ON_WM_LBUTTONDOWN()
END_MESSAGE_MAP()
CMainWnd::CMainWnd()
{
x1=y1=20;
x2=y2=200;
}
CMainWnd::~CMainWnd()
{
}
void CMainWnd::OnLButtonDown(UINT nFlags,CPoint point)
{
CDC *pDC=GetDC;
pDC->Ellipse(x1,y1,x2,y2);
ReleaseDC(pDC);
}
BOOL CMyApp::InitInstance()
{
CMainWnd *p=new CMainWnd;
p->Create(0,"chen");
this->m_pMainWnd=p;
p->ShowWindow(SW_SHOWMAXIMIZED);
p->UpdateWindow();
return TRUE;
}
CMyApp myapp;
--------------------Configuration: project9 - Win32 Debug--------------------
Compiling...
chen.cpp
F:\dxwvc6examp\project9\chen.cpp(9) : error C2084: function '__thiscall CMainWnd::CMainWnd(void)' already has a body
F:\dxwvc6examp\project9\chen.cpp(10) : error C2065: 'x1' : undeclared identifier
F:\dxwvc6examp\project9\chen.cpp(10) : error C2065: 'y1' : undeclared identifier
F:\dxwvc6examp\project9\chen.cpp(11) : error C2065: 'x2' : undeclared identifier
F:\dxwvc6examp\project9\chen.cpp(11) : error C2065: 'y2' : undeclared identifier
F:\dxwvc6examp\project9\chen.cpp(15) : error C2084: function '__thiscall CMainWnd::~CMainWnd(void)' already has a body
F:\dxwvc6examp\project9\chen.cpp(18) : error C2509: 'OnLButtonDown' : member function not declared in 'CMainWnd'
f:\dxwvc6examp\project8\w.h(8) : see declaration of 'CMainWnd'
F:\dxwvc6examp\project9\chen.cpp(26) : error C2264: 'CMainWnd::CMainWnd' : error in function definition or declaration; function not called
Error executing cl.exe.
project9.exe - 8 error(s), 0 warning(s)