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

📄 ex07bdoc.cpp

📁 ISO9000质量管理小程序
💻 CPP
字号:
// Ex07bDoc.cpp : implementation of the CEx07bDoc class
//

#include "stdafx.h"
#include "Ex07b.h"

#include "Ex07bDoc.h"

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

/////////////////////////////////////////////////////////////////////////////
// CEx07bDoc

IMPLEMENT_DYNCREATE(CEx07bDoc, CDocument)

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

/////////////////////////////////////////////////////////////////////////////
// CEx07bDoc construction/destruction

CEx07bDoc::CEx07bDoc()
{
	// TODO: add one-time construction code here
//m_lShujumin=10000;
//m_lShujumax=-10000;
//m_zCount=0;
//m_lk=0;
//	 CZjdshuju * pZjdshuju;
//	 m_unit=pZjdshuju->m_unit;

}

CEx07bDoc::~CEx07bDoc()
{
}

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

	// TODO: add reinitialization code here
	// (SDI documents will reuse this document)
//	m_unit=2;
	m_lShujumin=10000;
	m_lShujumax=-10000;
	 m_zCount=0;
	 m_lk=0;

	return TRUE;
}



/////////////////////////////////////////////////////////////////////////////
// CEx07bDoc serialization

void CEx07bDoc::Serialize(CArchive& ar)
{
	if (ar.IsStoring())
	{
		// TODO: add storing code here
		ar<<m_iunit<<m_lShujumin<<m_lShujumax;
		
		m_dataList.Serialize(ar);
		m_zdataList.Serialize(ar);

//		ar<<m_lCode<<m_sName<<m_lAge<<m_lScore;
	}
	else
	{
		// TODO: add loading code here
		ar>>m_iunit>>m_lShujumin>>m_lShujumax;
		m_dataList.Serialize(ar);
		m_zdataList.Serialize(ar);

	}
}
	IMPLEMENT_SERIAL(CStudent,CObject,1)
	IMPLEMENT_SERIAL(CZshuju,CObject,1)

/////////////////////////////////////////////////////////////////////////////
// CEx07bDoc diagnostics

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

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

/////////////////////////////////////////////////////////////////////////////
// CEx07bDoc commands
	
//IMPLEMENT_DYNCREATE(CStudent,CObject)
CStudent::CStudent()
{
	m_nCode=0;
	m_sName="NoName";
	m_lAge=0;
	m_lScore=0;
}
CStudent::CStudent(float code,CString name)
{
	m_nCode=code;
	m_sName=name;  //char *  不能用=
//	m_lAge=age;
//	m_lScore=score;
}


//IMPLEMENT_DYNCREATE(CZshuju,CObject)
CZshuju::CZshuju()
{

	float m_lShuju=0;  //输入数据
//	float m_lShujumax=-10000;
//	float m_lShujumin=10000;
//	float m_lMiddle=0;
//	long m_lHz=0;
//	long m_lUi=0;
//	long m_lFiui=0;
//	long m_lFiui2=0;

}

CZshuju::CZshuju(float shuju)
{
	m_lShuju=shuju;
}

IMPLEMENT_DYNCREATE(CZftfzsj,CObject)
CZftfzsj::CZftfzsj()
{
	 m_zmin=-10000;
	 m_zmax=10000;
	 m_zMiddle=0;
	 m_zfi=0;
	 m_zui=0;
	 m_zfiui=0;
	 m_zfiui2=0;

}
CZftfzsj::CZftfzsj(float min,float max)
{
	m_zmin=min;
	m_zmax=max;

}


void CEx07bDoc::DeleteContents() 
{
	// TODO: Add your specialized code here and/or call the base class
	while(!m_dataList.IsEmpty())
		delete m_dataList.RemoveHead();
	while(!m_zdataList.IsEmpty())
		delete m_zdataList.RemoveHead();

//	while(!m_zfdataList.IsEmpty())
//		delete m_zfdataList.RemoveHead();



	CDocument::DeleteContents();
}
void CStudent::Serialize(CArchive &ar)
   {
	if(ar.IsStoring())
  	   ar<<m_nCode<<m_sName<<m_lAge<<m_lScore;
	else
	{
	    
		ar>>m_nCode>>m_sName>>m_lAge>>m_lScore;
		
	}
   }
void CZshuju::Serialize(CArchive &ar)
{
	if (ar.IsStoring())
		ar<<m_lShuju;
	else
		ar>>m_lShuju;
}



BOOL CEx07bDoc::OnOpenDocument(LPCTSTR lpszPathName) 
{
	if (!CDocument::OnOpenDocument(lpszPathName))
		return FALSE;
	
	// TODO: Add your specialized creation code here
	curPos = m_dataList.GetHeadPosition();	
	Zpos =   m_zdataList.GetHeadPosition();


//	CWnd *m_Wnd=NULL;
//	m_Wnd=GetDlgItem(IDD_EX07B_FORM,IDC_TONGJI);
//	m_Wnd->EnableWindow();
	return TRUE;
}

⌨️ 快捷键说明

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