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

📄 readme.wzd

📁 本书通过85个实例全面讲述了应用MFC进行Visual C++编程的思想。每个实例均以编写一个应用程序要走的步骤编写。全书共分四部分进行介绍
💻 WZD
字号:
/////////////////////////////////////////////////////////////////////
// Example files.
/////////////////////////////////////////////////////////////////////

WzdInfo1.cpp -- sample data classes that have been enabled to be serialized
WzdInfo1.h
WzdInfo2.cpp
WzdInfo2.h

/////////////////////////////////////////////////////////////////////
// Modify the Document Class.
/////////////////////////////////////////////////////////////////////

// 1) from this class's Serialize() function, call the Serialize() functions
// of all data classes you wish to serialize to disk
void CWzdDoc::Serialize(CArchive& ar)
{
	int nCount;
	if (ar.IsStoring())
	{
		nCount = m_WzdInfo1List.GetCount();
		ar << nCount;
		for (POSITION pos = m_WzdInfo1List.GetHeadPosition(); pos; )
		{
			CWzdInfo1 *pInfo = m_WzdInfo1List.GetNext(pos);
			pInfo->Serialize(ar);
		}
	}
	else
	{
		ar >> nCount;
		while (nCount-- > 0)
		{
			CWzdInfo1* pInfo = new CWzdInfo1;
			pInfo->Serialize(ar);
			m_WzdInfo1List.AddTail(pInfo);
		}
	}
}


// 2) also implement this class's DeleteContents() function to delete any objects
// maintained by this class. This function is called with "New" and "Open" menu
// commands
void CWzdDoc::DeleteContents() 
{
	// called with new and open document
	// opportunity to initialize the data collections that make up our document
	while (!m_WzdInfo1List.IsEmpty())
	{
		delete m_WzdInfo1List.RemoveHead();
	}


	CDocument::DeleteContents();
}

/////////////////////////////////////////////////////////////////////
// From: Visual C++ MFC Programming by Example by John E. Swanke
// Copyright (C) 1998 jeswanke. All rights reserved.
/////////////////////////////////////////////////////////////////////

⌨️ 快捷键说明

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