如何在视图变量中定义Cpoint类的变量
来源:百度知道 编辑:UC知道 时间:2024/06/20 01:49:21
// 121View.h : interface of the CMy121View class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_121VIEW_H__19F5AC42_0B57_4F11_ABFA_DBE056A9A101__INCLUDED_)
#define AFX_121VIEW_H__19F5AC42_0B57_4F11_ABFA_DBE056A9A101__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CMy121View : public CView
{
protected: // create from serialization only
CMy121View();
DECLARE_DYNCREATE(CMy121View)
// Attributes
public:
CMy121Doc* GetDocument();
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMy121View)
public:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
protected:
virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_121VIEW_H__19F5AC42_0B57_4F11_ABFA_DBE056A9A101__INCLUDED_)
#define AFX_121VIEW_H__19F5AC42_0B57_4F11_ABFA_DBE056A9A101__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CMy121View : public CView
{
protected: // create from serialization only
CMy121View();
DECLARE_DYNCREATE(CMy121View)
// Attributes
public:
CMy121Doc* GetDocument();
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMy121View)
public:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
protected:
virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
就写在类定义的开始位置,写在这几行下面比较合适:
class CMy121View : public CView
{
protected: // create from serialization only
CMy121View();
DECLARE_DYNCREATE(CMy121View)
public:
Cpoint m_StartPoint;
。。。。。
你的 变量类型单词拼写错误了。。。。应该是CPoint m_StartPoint,注意“P”是大写。我就是犯了同样的错误啊