你需要好好看一下MSDN上的这一段: Serialization: Making a Serializable Class Five main steps are required to make a class serializable. They are listed below and explained in the following sections: 1. Deriving your class from CObject (or from some class derived from CObject). 2. Overriding the Serialize member function. 3. Using the DECLARE_SERIAL macro in the class declaration. 4. Defining a constructor that takes no arguments. 5. 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. // 注意看这里有一段话
Serialization: Making a Serializable Class
Five main steps are required to make a class serializable. They are listed below and explained in the following sections: 1. Deriving your class from CObject (or from some class derived from CObject). 2. Overriding the Serialize member function. 3. Using the DECLARE_SERIAL macro in the class declaration. 4. Defining a constructor that takes no arguments. 5. 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.
// 注意看这里有一段话