双11狂欢大促

盲盒赢 定制羽绒服

开启惊喜盲盒,抽取你的专属好礼

— 惊喜奖品抢先看 —

程序编译错误,帮忙看看

有趣的代码 有趣的代码 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
我弄个含点,直线,矩形,椭圆的程序,但编译错误,弄不来。
高手救命
// GraphicView.h : interface of the CGraphicView class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_GRAPHICVIEW_H__E87962B2_2A30_49E7_B386_4AE78DA5FFC5__INCLUDED_)
#define AFX_GRAPHICVIEW_H__E87962B2_2A30_49E7_B386_4AE78DA5FFC5__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000


class CGraphicView : public CView
{
protected: // create from serialization only
CGraphicView();
DECLARE_DYNCREATE(CGraphicView)

// Attributes
public:
CGraphicDoc* GetDocument();

// Operations
public:

// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CGraphicView)
public:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
protected:
virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
//}}AFX_VIRTUAL

// Implementation
public:
virtual ~CGraphicView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions
protected:
//{{AFX_MSG(CGraphicView)
afx_msg void OnDot();
afx_msg void OnLine();
afx_msg void OnRectangle();
afx_msg void OnEllipse();
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
CPoint m_ptOrigin;
UINT m_nDrawType;
};

#ifndef _DEBUG // debug version in GraphicView.cpp
inline CGraphicDoc* CGraphicView::GetDocument()
{ return (CGraphicDoc*)m_pDocument; }
#endif

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_GRAPHICVIEW_H__E87962B2_2A30_49E7_B386_4AE78DA5FFC5__INCLUDED_)



// GraphicView.cpp : implementation of the CGraphicView class
//



#include "stdafx.h"
#include "Graphic.h"

#include "GraphicDoc.h"
#include "GraphicView.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CGraphicView

IMPLEMENT_DYNCREATE(CGraphicView, CView)

BEGIN_MESSAGE_MAP(CGraphicView, CView)
//{{AFX_MSG_MAP(CGraphicView)
ON_COMMAND(IDM_DOT, OnDot)
ON_COMMAND(IDM_LINE, OnLine)
ON_COMMAND(IDM_RECTANGLE, OnRectangle)
ON_COMMAND(IDM_ELLIPSE, OnEllipse)
ON_WM_LBUTTONDOWN()
ON_WM_LBUTTONUP()
//}}AFX_MSG_MAP
// Standard printing commands
ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CGraphicView construction/destruction

CGraphicView::CGraphicView()
{
// TODO: add construction code here
m_nDrawType=0;
m_ptOrigin=0;
}

CGraphicView::~CGraphicView()
{
}

BOOL CGraphicView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs

return CView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CGraphicView drawing

void CGraphicView::OnDraw(CDC* pDC)
{
CGraphicDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
}

/////////////////////////////////////////////////////////////////////////////
// CGraphicView printing

BOOL CGraphicView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}

void CGraphicView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}

void CGraphicView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}

/////////////////////////////////////////////////////////////////////////////
// CGraphicView diagnostics

#ifdef _DEBUG
void CGraphicView::AssertValid() const
{
CView::AssertValid();
}

void CGraphicView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}

CGraphicDoc* CGraphicView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CGraphicDoc)));
return (CGraphicDoc*)m_pDocument;
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CGraphicView message handlers

void CGraphicView::OnDot()
{
// TODO: Add your command handler code here
m_nDrawType=1;
}

void CGraphicView::OnLine()
{
// TODO: Add your command handler code here
m_nDrawType=2;
}

void CGraphicView::OnRectangle()
{
// TODO: Add your command handler code here
m_nDrawType=3;
}

void CGraphicView::OnEllipse()
{
// TODO: Add your command handler code here
m_nDrawType=4;
}

void CGraphicView::OnLButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
m_ptOrigin=point;
CView::OnLButtonDown(nFlags, point);
}

void CGraphicView::OnLButtonUp(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
CClientDC dc(this);
CBrush *pBrush=CBrush::FromHandle((HBRUSH)GetStockObject(NULL_BRUSH));
dc.SelectObject(pBrush);

switch(m_nDrawType)
{
case 1:
dc.SetPixel(point,RGB(0,0,0));
break;
case 2:
dc.MoveTo(m_ptOrigin);
dc.LineTo(point);
break;
case 3:
dc.Rectangle(CRect(m_ptOrigin,point));
break;
case 4:
dc.Ellipse(CRect(m_ptOrigin,point));
break;
CView::OnLButtonUp(nFlags, point);
}
--------------------Configuration: Graphic - Win32 Debug--------------------
Compiling...
Graphic.cpp
D:\SY\新建文件夹\Graphic\Graphic.cpp(16) : error C2143: syntax error : missing ';' before 'private'
GraphicView.cpp
D:\SY\新建文件夹\Graphic\GraphicView.cpp(168) : fatal error C1004: unexpected end of file found
Generating Code...
执行 cl.exe 时出错.

Graphic.exe - 1 error(s), 0 warning(s)

...全文

相关推荐

Web工程,发布IoT项目的网站.zip

Web工程,发布IoT项目的网站.zip项目工程资源经过严格测试运行并且功能上ok,可复现复刻,拿到资料包后可实现复刻出一样的项目,本人系统开发经验充足(全栈),有任何使用问题欢迎随时与我联系,我会及时为您解惑,提供帮助 【资源内容】:包含源码、工程文件、说明等。资源质量优质,放心下载使用!可实现复现;设计报告可借鉴此项目;该资源内项目代码都经过测试运行,功能ok 【项目价值】:可用在相关项目设计中,皆可应用在项目、毕业设计、课程设计、期末/期中/大作业、工程实训、大创等学科竞赛比赛、初期项目立项、学习/练手等方面,可借鉴此优质项目实现复刻,设计报告也可借鉴此项目,也可基于此项目来扩展开发出更多功能 【提供帮助】:有任何使用上的问题欢迎随时与我联系,及时抽时间努力解答解惑,提供帮助 【附带帮助】:若还需要相关开发工具、学习资料等,我会提供帮助,提供资料,鼓励学习进步 质量优质,放心下载使用。下载后请首先打开说明文件(如有);项目工程可实现复现复刻,如果基础还行,也可在此程序基础上进行修改,以实现其它功能。供开源学习/技术交流/学习参考,勿用于商业用途,网络商品/电子资源资料具可复制性不支持退款。质量优质,放心下载使用。

热爱技术。

PHP校园二手信息网站的设计与开发(源代码+论文).zip

PHP校园二手信息网站的设计与开发(源代码+论文).zip

CyMylive.

阿里云IoT物联网平台 MQTT 2路开关+三路数据(Web).zip

阿里云物联网源码

One Piece&

vs2010中如何发布网站及打包web项目生成安装文件

本资料共计11页文档,按照文档要求即可完成发布网站、打包web项目生成安装文件。 vs2010中如何发布网站及打包web项目生成安装文件, vs2010发布、打包安装程序(超全超详细) 。

alitaotao

lazyiot:一款开源的web组态,IOT,物联网产品

lazyiot 一款开源的web组态,IOT,物联网产品 最新版本修改了部分Bug. 目前整个解决方案采用vs2017进行编译,编译后的所有程序放置在系统目录下的Publish,在Publish目录下包含IOCenter和IOStation 两个文件夹。 IOCenter 是中心服务器的应用程序 IOStation 是采集站的应用程序,在该程序下包含三个exe可执行文件:IOManager.exe 采集站工程管理器,IOMonitor.exe负责采集站上的数据采集与转存,ScadaFlowDesign.exe是组态设计器。 服务器端部署: 1 首先编译发布web端程序,发布工程中Scada.WebServer/UI/SCADA.Web网站工程,将发布的文件拷贝到要部署的电脑或者是服务器上。 2 在发布的电脑上安装iis7以上版本,.net4.5 版本,部署web工程 3 打开部署电脑的we

穆庭秋
评论 6
收藏 已收藏
分享
返回顶部
有趣的代码
VC/MFC 16,551 成员 421,605 内容