一个得分相当容易的莱鸟问题

guanchen 2003-10-20 05:00:26
我是一个初学VC的莱鸟,以下是一个CMFCView类的声明,看不太懂,麻烦那位高手逐句注释一下!
谢谢先!!

// MFCView.h : interface of the CMFCView class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_MFCVIEW_H__AAD7AB0B_1556_4D21_8473_FA7BBF061498__INCLUDED_)
#define AFX_MFCVIEW_H__AAD7AB0B_1556_4D21_8473_FA7BBF061498__INCLUDED_

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


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

// Attributes
public:
CMFCDoc* GetDocument();

// Operations
public:

// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMFCView)
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 ~CMFCView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions
protected:
//{{AFX_MSG(CMFCView)
// 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()
};

#ifndef _DEBUG // debug version in MFCView.cpp
inline CMFCDoc* CMFCView::GetDocument()
{ return (CMFCDoc*)m_pDocument; }
#endif

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

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

#endif // !defined(AFX_MFCVIEW_H__AAD7AB0B_1556_4D21_8473_FA7BBF061498__INCLUDED_)
...全文
49 16 打赏 收藏 转发到动态 举报
写回复
用AI写文章
16 条回复
切换为时间正序
请发表友善的回复…
发表回复
guanchen 2003-10-25
  • 打赏
  • 举报
回复
谢谢了
Anjuse 2003-10-24
  • 打赏
  • 举报
回复
多看看C++的语法啦

看看基本的
yintongshun 2003-10-24
  • 打赏
  • 举报
回复
多看看C++吧
zgqcool2002 2003-10-24
  • 打赏
  • 举报
回复
进来看看
dzqsuper 2003-10-24
  • 打赏
  • 举报
回复
就是吗
有好我东西
你也不要理解的那么多吗
guanchen 2003-10-24
  • 打赏
  • 举报
回复
好像说得挺对的!
谢谢大家了
gezihou 2003-10-20
  • 打赏
  • 举报
回复
//{{和//}}是VC加上的特殊语句,一般是VC自动加上去的消息响应函数什么的,之间的语句也一般不要自己加上去,最好也不要改动(当然也可以改)。
southwall 2003-10-20
  • 打赏
  • 举报
回复
"//"之后的是注释,只是为了让别人更清楚的阅读程序,并不属于程序的一部分
southwall 2003-10-20
  • 打赏
  • 举报
回复
DECLARE_MESSAGE_MAP() 是声明消息映射
guanchen 2003-10-20
  • 打赏
  • 举报
回复
To: hotness28(小左)

//{{AFX_VIRTUAL(CMFCView)
//}}AFX_VIRTUAL
上面这两句什么意思,虑函数一定要加到它们之间吗

//{{AFX_MSG(CMFCView)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
上面四句又是什么意思,那些加到它们之间,那些加到它们外面0

DECLARE_MESSAGE_MAP()
上面这一句又是什么意思

谢谢先!
hotness28 2003-10-20
  • 打赏
  • 举报
回复
很快我就可以变成三星拉
哈哈
hotness28 2003-10-20
  • 打赏
  • 举报
回复
#是预编译的语句,这里防止头文件被包含两遍

虚函数是继承父类的
guanchen 2003-10-20
  • 打赏
  • 举报
回复
我想大家解释一下前面带#号的语句、及那些虚函数是怎么来的!

麻烦大家了!
BuZhang_AP97091 2003-10-20
  • 打赏
  • 举报
回复
先学C++语法,很有必要。
psh0201 2003-10-20
  • 打赏
  • 举报
回复
这还容易得分啊,让人怎么给你讲啊!
wuxfBrave 2003-10-20
  • 打赏
  • 举报
回复
那个地方看不懂
class CMFCView : public CView
{
protected: // create from serialization only
CMFCView();
DECLARE_DYNCREATE(CMFCView) //动态创建

// Attributes
public:
CMFCDoc* GetDocument();

// Operations
public:

// Overrides 虚函数
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMFCView)
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 ~CMFCView();
#ifdef _DEBUG//如果定义了_DEBUG,就是调试状态下
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions 消息映射函数
protected:
//{{AFX_MSG(CMFCView)
// 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()
};

#ifndef _DEBUG // debug version in MFCView.cpp
inline CMFCDoc* CMFCView::GetDocument()
{ return (CMFCDoc*)m_pDocument; }
#endif

16,467

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • Web++
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

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