//1view.h=======================================// 1View.h : interface of the CMy1View class///////////////////////////////////////////////////////////////////////////////#if !defined(AFX_1VIEW_H__906C299A_B069_4930_BB13_F6532075841F__INCLUDED_)#define AFX_1VIEW_H__906C299A_B069_4930_BB13_F6532075841F__INCLUDED_#if _MSC_VER > 1000#pragma once#endif // _MSC_VER > 1000class CMy1View : public CView{protected: // create from serialization only CMy1View(); DECLARE_DYNCREATE(CMy1View)// Attributespublic: CMy1Doc* GetDocument();// Operationspublic:// Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CMy1View) 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// Implementationpublic: virtual ~CMy1View();#ifdef _DEBUG virtual void AssertValid() const; virtual void Dump(CDumpContext& dc) const;#endifprotected:// Generated message map functionsprotected: //{{AFX_MSG(CMy1View) // NOTE - the ClassWizard will add and remove member functions here. // DO NOT EDIT what you see in these blocks of generated code ! //}}AFX_MSG DECLARE_MESSAGE_MAP()private: void DrawScene() ; HGLRC m_hRC;};#ifndef _DEBUG // debug version in 1View.cppinline CMy1Doc* CMy1View::GetDocument() { return (CMy1Doc*)m_pDocument; }#endif///////////////////////////////////////////////////////////////////////////////{{AFX_INSERT_LOCATION}}// Microsoft Visual C++ will insert additional declarations immediately before the previous line.#endif // !defined(AFX_1VIEW_H__906C299A_B069_4930_BB13_F6532075841F__INCLUDED_)OPENGL做图入门,用mfc画茶壶的出错如下:--------------------Configuration: 1 - Win32 Debug--------------------Compiling...1View.cppC:/Users/flyran/完成作业/计算机图形学 一/shiyan/1/1View.cpp(126) : error C2509: 'OnCreate' : member function not declared in 'CMy1View' c:/users/flyran/完成作业/计算机图形学 一/shiyan/1/1view.h(13) : see declaration of 'CMy1View'C:/Users/flyran/完成作业/计算机图形学 一/shiyan/1/1View.cpp(164) : error C2509: 'OnDestroy' : member function not declared in 'CMy1View' c:/users/flyran/完成作业/计算机图形学 一/shiyan/1/1view.h(13) : see declaration of 'CMy1View'C:/Users/flyran/完成作业/计算机图形学 一/shiyan/1/1View.cpp(179) : error C2509: 'OnSize' : member function not declared in 'CMy1View' c:/users/flyran/完成作业/计算机图形学 一/shiyan/1/1view.h(13) : see declaration of 'CMy1View'执行 cl.exe 时出错.1View.obj - 1 error(s), 0 warning(s)怎么改正!不胜感激
|