Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2341398
  • 博文数量: 816
  • 博客积分: 10000
  • 博客等级: 上将
  • 技术积分: 5010
  • 用 户 组: 普通用户
  • 注册时间: 2008-12-17 17:57
文章分类

全部博文(816)

文章存档

2011年(1)

2008年(815)

分类:

2008-12-17 18:07:23

我是C++初学者,我有一组源码,但看不懂一些部分的功用
教授要我解释各个部分功用
还望各位指点指点,帮我用文字解释解释

1)
// DocViewDemoView.cpp : implementation of the CDocViewDemoView class
//
#include "stdafx.h"
#include "DocViewDemo.h"

#include "DocViewDemoDoc.h"
#include "DocViewDemoView.h"
#include "DocViewDemoDlg.h"

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


2)
// CDocViewDemoView

IMPLEMENT_DYNCREATE(CDocViewDemoView, CView)

BEGIN_MESSAGE_MAP(CDocViewDemoView, CView)
//{{AFX_MSG_MAP(CDocViewDemoView)
// 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()


3)
// CDocViewDemoView construction/destruction

CDocViewDemoView::CDocViewDemoView()
{
// TODO: add construction code here

}

CDocViewDemoView::~CDocViewDemoView()
{
}

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

return CView::PreCreateWindow(cs);
}


4)
void CDocViewDemoView::OnDraw(CDC* pDC)
{
CDocViewDemoDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here

FILE *file;
CString stringTemp;
char buffer[65535];
double Tmax = 0, Tmin = 9999;
char *p = buffer;
int lineCount = 0, mycount = 0, fileLine = 0, i =0, count = 0, X, Y;
CPen bluePen, Pen[50];
bluePen.CreatePen(PS_SOLID, 1, RGB(0, 0, 0));
。。。。。。


5)
// CDocViewDemoView printing

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

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

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


6)
// CDocViewDemoView diagnostics

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

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

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


就是这些搞到我求生不得求死不能啊
8/12/07就是死期了,救命啊

--------------------next---------------------

阅读(1035) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~