MFC序列化 反序列化流程

1.在序列化的类里面声明

DECLARE_SERIAL_DSCRIPT(class)

2.在类外声明父子类关系

IMPLEMENT_SERIAL( 派生类,基类,0)

3.序列化函数

 1 void Cfyq_scope::Serialize(CArchive& ar)
 2 {
 3     int rightcode = 1;//版本号
 4     if(ar.IsStoring())
 5     {
 6         ar << rightcode;
 7     }
 8     else
 9     {
10         ar >> rightcode;
11     }
12     
13 }

 

posted @ 2019-11-07 14:12  冷眼旁观你的泪  阅读(282)  评论(0编辑  收藏  举报