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

📄 person.h

📁 本程序介绍vc中串行化方法
💻 H
字号:
// Person.h: interface for the CPerson class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_PERSON_H__AAAEF499_7D16_4C61_ACF4_A0F41FA7E336__INCLUDED_)
#define AFX_PERSON_H__AAAEF499_7D16_4C61_ACF4_A0F41FA7E336__INCLUDED_

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

class CPerson : public CObject  
{
	DECLARE_SERIAL(CPerson)
public:
	virtual void Serialize(CArchive &ar);
	//Functions for setting the variables
	void SetEmployed(BOOL bEmployed) { m_bEmployed=bEmployed;}
	void SetMaritalStat(int iStat) {m_iMaritalStatus=iStat;}
	void SetAge(int iAge) { m_iAge=iAge;}
	void SetName(CString sName) { m_sName=sName;}
	//Functions for getting the variables
	BOOL GetEmployed() { return m_bEmployed;}
	int GetMaritalStat() { return m_iMaritalStatus;}
	int GetAge(){ return m_iAge;}
	CString GetName() {return m_sName;}
	CPerson();
	virtual ~CPerson();
private:
	BOOL m_bEmployed;
	int m_iAge;
	CString m_sName;
	int m_iMaritalStatus;

};

#endif // !defined(AFX_PERSON_H__AAAEF499_7D16_4C61_ACF4_A0F41FA7E336__INCLUDED_)

⌨️ 快捷键说明

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