Vc++ 6.0编译问题请教
#include <afxwin.h>class CMyApp:public CWinApp
{
public:
virtual BOOL InitInstance();
};
class CMainWnd:public CFrameWnd
{
protected:
afx_msg void OnLButtonDown(UINT nFlags,CPoint point);
COLORREF crColor;
int x1,x2,y1,y2,x3;
/* afx_msg void OnLButtonDown(UINT nFlags,CPoint point)
{
CDC *pDC=GetDC();
pDC->Ellipse(x1,y1,x2,y2);
ReleaseDC(pDC);
}*/
public:
// CMainWnd();
CMainWnd()
{
x1=y1=20;
x2=y2=x3=200;
r=50;
crColor=RGB(255,255,0);
}
// ~CMainWnd();
CMainWnd::~CMainWnd()
{
}
DECLARE_MESSAGE_MAP();
};
#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();
CPen mypen;
// mypen.CreatePen(PS_SOLID,3,crColor);
// pDC->SelectObject(&mypen);
pDC->Ellipse(400-x1,300-x1,400+x1,300+x1);
pDC->Ellipse(x3,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...
w.cpp
F:\dxwvc6examp\project9\w.cpp(24) : error C2065: 'x3' : undeclared identifier
Error executing cl.exe.
project9.exe - 1 error(s), 0 warning(s)