⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vcexpshi10doc.cpp

📁 用VC编写的一个单文档程序
💻 CPP
字号:
// VCexpshi10Doc.cpp : implementation of the CVCexpshi10Doc class
//

#include "stdafx.h"
#include "VCexpshi10.h"

#include "VCexpshi10Doc.h"


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

/////////////////////////////////////////////////////////////////////////////
// CVCexpshi10Doc

IMPLEMENT_DYNCREATE(CVCexpshi10Doc, CDocument)

BEGIN_MESSAGE_MAP(CVCexpshi10Doc, CDocument)
	//{{AFX_MSG_MAP(CVCexpshi10Doc)
		// 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
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CVCexpshi10Doc construction/destruction

CVCexpshi10Doc::CVCexpshi10Doc() //为类的变量的赋初值
{
	i=0;//为i赋值为0
	circles=new Circle[1000];//为Circle数组分配空间
	// TODO: add one-time construction code here

}

CVCexpshi10Doc::~CVCexpshi10Doc()
{
		delete []circles;
}

BOOL CVCexpshi10Doc::OnNewDocument()
{
	if (!CDocument::OnNewDocument())
		return FALSE;

	// TODO: add reinitialization code here
	// (SDI documents will reuse this document)
	return TRUE;
}



/////////////////////////////////////////////////////////////////////////////
// CVCexpshi10Doc serialization

void CVCexpshi10Doc::Serialize(CArchive& ar)
{
	if (ar.IsStoring())
	{
		// TODO: add storing code here
		for(int j=0;j<i;j++)
		{
			ar<<circles[j].x<<circles[j].y<<circles[j].radius<<circles[j].c;
		}
		
	}
	else
	{
		// TODO: add loading code here
		for(int j=0;j<i;j++)
		{
			ar>>circles[j].x>>circles[j].y>>circles[j].radius<<circles[j].c;
		
		}	
	}
//	Array.Serialize(ar);
//	
}

/////////////////////////////////////////////////////////////////////////////
// CVCexpshi10Doc diagnostics

#ifdef _DEBUG
void CVCexpshi10Doc::AssertValid() const
{
	CDocument::AssertValid();
}

void CVCexpshi10Doc::Dump(CDumpContext& dc) const
{
	CDocument::Dump(dc);
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CVCexpshi10Doc commands

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -