📄 user.h
字号:
//user.h
//用于保存用户信息的类,支持串行化
#include "phonebookDlg.h"
class newuser :public CObject/////新数据结构
{
public :
CString m_showadd;//用于显示
CString m_showemail;//email
CString m_showinformation;
CString m_showname;
CString m_shownumber;
CString m_showqq;
CString m_called;///称谓
newuser();
newuser(CString showname,
CString shownumber,
CString showemail,
CString showqq,
CString showinformation,
CString showadd,
CString called);
void Serialize(CArchive& ar);
DECLARE_SERIAL(newuser)
};
IMPLEMENT_SERIAL(newuser, CObject, 2 )
newuser::newuser()
{
}
void newuser::Serialize(CArchive& ar)
{
if(ar.IsStoring())//数据存储顺序:地址、EMAIL、信息(备注)、姓名、手机号、QQ号
{
ar<<m_showadd<<m_showemail<<m_showinformation<<m_showname<<m_shownumber
<<m_showqq<<m_called;
}
else
{
ar>>m_showadd>>m_showemail>>m_showinformation>>m_showname>>m_shownumber
>>m_showqq>>m_called;
}
}
newuser::newuser( CString showname,
CString shownumber,
CString showemail,
CString showqq,
CString showinformation,
CString showadd,
CString called)
{
m_showadd=showadd;/////地址
m_showemail=showemail;////email
m_showinformation=showinformation;////信息
m_showname=showname;////姓名
m_shownumber=shownumber;////手机号
m_showqq=showqq;////QQ号
m_called=called;///称谓
}
class user :public CObject////////旧数据结构
{
public :
CString m_showadd;//用于显示
CString m_showemail;//email
CString m_showinformation;
CString m_showname;
CString m_shownumber;
CString m_showqq;
user();
user(CString showname,
CString shownumber,
CString showemail,
CString showqq,
CString showinformation,
CString showadd);
void Serialize(CArchive& ar);
DECLARE_SERIAL(user)
};
IMPLEMENT_SERIAL(user, CObject, 1 )
user::user()
{
}
void user::Serialize(CArchive& ar)
{
if(ar.IsStoring())//数据存储顺序:地址、EMAIL、信息(备注)、姓名、手机号、QQ号
{
ar<<m_showadd<<m_showemail<<m_showinformation<<m_showname<<m_shownumber
<<m_showqq;
}
else
{
ar>>m_showadd>>m_showemail>>m_showinformation>>m_showname>>m_shownumber
>>m_showqq;
}
}
user::user( CString showname,
CString shownumber,
CString showemail,
CString showqq,
CString showinformation,
CString showadd)
{
m_showadd=showadd;/////地址
m_showemail=showemail;////email
m_showinformation=showinformation;////信息
m_showname=showname;////姓名
m_shownumber=shownumber;////手机号
m_showqq=showqq;////QQ号
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -