DECLARE_SERIAL/IMPLEMENT_SERIAL宏

DECLARE_SERIAL宏定义:

#ifndef _WIN32_WCE_NO_ARCHIVE_SUPPORT
#define DECLARE_SERIAL(class_name) /
 _DECLARE_DYNCREATE(class_name) /
 AFX_API friend CArchive& AFXAPI operator>>(CArchive& ar, class_name* &pOb);

#else // !_WIN32_WCE_NO_ARCHIVE_SUPPORT

#define DECLARE_SERIAL(class_name) /
 _DECLARE_DYNCREATE(class_name) 

IMPLEMENT_SERIAL宏定义:

#ifndef _WIN32_WCE_NO_ARCHIVE_SUPPORT
#define IMPLEMENT_SERIAL(class_name, base_class_name, wSchema) /
 CObject* PASCAL class_name::CreateObject() /
  { return new class_name; } /
 extern AFX_CLASSINIT _init_##class_name; /
 _IMPLEMENT_RUNTIMECLASS(class_name, base_class_name, wSchema, /
  class_name::CreateObject, &_init_##class_name) /
 AFX_CLASSINIT _init_##class_name(RUNTIME_CLASS(class_name)); /
 CArchive& AFXAPI operator>>(CArchive& ar, class_name* &pOb) /
  { pOb = (class_name*) ar.ReadObject(RUNTIME_CLASS(class_name)); /
   return ar; }
#else
#define IMPLEMENT_SERIAL(class_name, base_class_name, wSchema) /
 CObject* PASCAL class_name::CreateObject() /
  { return new class_name; } /
 extern AFX_CLASSINIT _init_##class_name; /
 _IMPLEMENT_RUNTIMECLASS(class_name, base_class_name, wSchema, /
  class_name::CreateObject, &_init_##class_name) /
 AFX_CLASSINIT _init_##class_name(RUNTIME_CLASS(class_name));
#endif // !_WIN32_WCE_NO_ARCHIVE_SUPPORT

你可能感兴趣的:(api,Class,pascal,archive)