标题:Vc++ 6.0编译问题请教
取消只看楼主
aoyufly
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2008-11-12
 问题点数:0 回复次数:0 
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)
搜索更多相关主题的帖子: 编译 
2008-11-15 20:16



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-244491-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.096104 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved