请问下.如果使用CArchive类来传递 结构体,
比如我要传递DEVMODE结构体.
好像CArchive类只能一个一个接受结构体参数么.
是不是要这样操作
DEVMODE* pdevmode;
CArchive ar;
ar<<pdevmode->dmDeviceName<<...
有没有比较快捷的方法?

解决方案 »

  1.   

    支持序列化的类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. 
      

  2.   

    顶,只要DEVMODE支持序列化就行