解决方案 »

  1.   

    MSDN中说明了序列化的方法:
    Five main steps are required to make a class serializable. They are listed below and explained in the following sections: Deriving your class from CObject (or from some class derived from CObject). Overriding the Serialize member function. Using the DECLARE_SERIAL macro in the class declaration. Defining a constructor that takes no arguments. Using the IMPLEMENT_SERIAL macro in the implementation file for your class. If you call Serialize directly rather than through the >> and << operators of CArchive, the last three steps are not required for serialization. 
      

  2.   

    多谢,我的意思是,DECLARE_SERIAL和IMPLEMENT_SERIAL这两个宏定义里,只有 >> 运算符,没有 << 运算符。
    但是为什么在序列化的时候可以使用对象进行 << 操作呢?