person.h

来自「本程序介绍vc中串行化方法」· C头文件 代码 · 共 38 行

H
38
字号
// 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 + =
减小字号Ctrl + -
显示快捷键?