error C2039: 'Line0' : is not a member of 'CMyVC3View'为什么会这样,怎么改啊?

weixin_42162172 2018-05-08 06:00:43
// MyVC3View.cpp : implementation of the CMyVC3View class
//

#include "stdafx.h"
#include "MyVC3.h"

#include "MyVC3Doc.h"
#include "MyVC3View.h"
#include "math.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CMyVC3View

IMPLEMENT_DYNCREATE(CMyVC3View, CView)

BEGIN_MESSAGE_MAP(CMyVC3View, CView)
//{{AFX_MSG_MAP(CMyVC3View)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}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()

/////////////////////////////////////////////////////////////////////////////
// CMyVC3View construction/destruction
const double PI=3.14159;
COLORREF colb;
double HI,poix[723],poiy[721];
int xm0,xz0;
CMyVC3View::CMyVC3View()
{
int i;
for(i=0;i<722;i++)
{
poix[i]=0;poiy[i]=0;
}
colb=RGB(220,220,220);HI=38;xm0=0;xz0=4;
// TODO: add construction code here

}

CMyVC3View::~CMyVC3View()
{
}

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

return CView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CMyVC3View drawing

void CMyVC3View::OnDraw(CDC* pDC)
{
CRect rect;
CFont fnBig;
CFont*poldFont;
fnBig.CreatePointFont(int(HI*8.0),"Arial",pDC);
poldFont=pDC->SelectObject(&fnBig);
FillRect0(pDC,colb,(0,0),800,500);
GetClientRect(&rect);
pDC->SetMapMode(MM_LOMETRIC);
pDC->SetViewportOrg(int(rect.right/10),int(rect.bottom/2));
if(xm0==0){}
else{huatu0(pDC);}
pDC->SelectObject(poldFont);
CMyVC3Doc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
}

/////////////////////////////////////////////////////////////////////////////
// CMyVC3View printing

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

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

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

/////////////////////////////////////////////////////////////////////////////
// CMyVC3View diagnostics

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

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

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

/////////////////////////////////////////////////////////////////////////////
// CMyVC3View message handlers
void CMyVC3View::FillRect0(CDC*pDC,COLORREF col,CPoint point,int chd,int kd)
{
CBrush newBrush(col);
CBrush*poldBrush;
poldBrush=pDC->SelectObject(&newBrush);
pDC->FillRect(CRect(point.x,point.y,point.x+chd,point.y+kd),&newBrush);
pDC->SelectObject(poldBrush);
newBrush.DeleteObject();
}
void CMyVC3View::Line0(CDC*pDC,double x1,double y1,double x2,double y2,int siw,COLORREF col)
{
CPen siPen;
Cpen*pOldPen;
siPen.CreatePen(PS_SOLID,siw,col);
pOldPen=pDC->SelectObject(&siPen);
pDC->MoveTo(int(HI*x1),int(HI*y1));
pDC->LineTo(int(HI*x2),int(HI*y2));
pDC->SelectObject(pOldPen);
siPen.DeleteObject();
}
void CMyVC3View::ASIN0()
{
float L,g,B,hg,R,hr,H,k;
int max,min,i;
printf("\nplease input L,g,B,hg,R,hr");
scanf("%f%f%f%f%f%f%",&L,&g,&B,&hg,&R,&hr);
for(i=min;i<max;i++)
{
H=2*hg*(1+R*(1-hr/hg));
k=L*g*B/H;
poix[i]=i;
poiy[i]=asin(k/(poix[i]*poix[i]));
}
}

void CMyVC3View::quxian0(CDC*pDC)
{
int j,ds;
double x1,y1,dsy;
char buf[25];
CString sc;
pDC->SetBkColor(colb);
ds=0;x1=0;y1=0;
wsprintf(buf,"%d",ds);
pDC->TextOut(-40,-10,buf,strlen(buf));
Line0(pDC,-10,0,75,0,4,RGB(0,0,0));
pDC->TextOut(int(HI*72.5),-40,"X(千米、时)");
for (j=0;j<24;j++)
{
x1+=3;ds+=15;
line0(pDC,x1,0,x1,0.5.1.RGB(0,0,0));
wsprintf(buf,"%d",ds);
}

dsy=0;
Line0(pDC,0,-20,0,20,4,RGB(0,0,0));
pDC->TextOut(-60,int(HI*24),"Y");
for(j=0;j<5;j++)
{
y1+=4;dsy+=1;
Line0(pDC,0,y1,0.5,y1,1,RGB(0,0,0));
sc.Format("%3,1f",dsy);
pDC->TextOut(-70,int(HI*y1)+20,sc,strlen(sc));
}
}
void CMyVC3View::huatu(CDC*pDC)
{
int x;
for(x=min;x<max;x++)
{
Line0(pDC,poix[i]/5,poiy[i]/0.25,poix[i+1]/5,poiy[i+1]/0.25,xz0,RGB(255,0,0));
}
}
...全文
306 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
赵4老师 2018-05-09
  • 打赏
  • 举报
回复
关于自己是否适合编程的很简单的测试: 在报纸或杂志上随便找一段约1000字的文章,在Word中输入一遍。输完后再参考下面答案: A里面有10处以上文字或标点错误 B里面没有文字或标点错误并敢为此跟人打赌 C里面没有文字或标点错误并且字体和排版完全与原稿一致 D打印在半透明的纸上和原稿重叠在一起检查一模一样,且自我感觉很有成就感 A不适合编程(理由:打字准确度偏低、粗心大意) B初级程序员(理由:打字准确度很高、认真细致、自信、理解全角半角概念) C高级程序员(理由:在B的基础上理解字体和排版也是电脑打印的重要因素、但相比D还不够偏执、精益求精、结果可验证) D软件项目经理(理由:能针对项目给出令人信服的细致到极点的需求说明和典型测试用例。用户几乎挑不出毛病。专业!) 如果想从A变成B的话,到我的资源http://download.csdn.net/detail/zhao4zhong1/4084259里面下载“适合程序员的键盘练习”
百合杰 2018-05-09
  • 打赏
  • 举报
回复
提示你说 :CMyVC3View 的类里没申明 Line0 函数啊

64,650

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧