Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
MFC
TRY
Expand Minimize
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

IMPLEMENT_SERIAL

Generates the C++ code necessary for a dynamic CObject-derived class with run-time access to the class name and position within the hierarchy.

IMPLEMENT_SERIAL(class_name, base_class_name, wSchema )

class_name

The actual name of the class.

base_class_name

The name of the base class.

wSchema

A UINT "version number" that will be encoded in the archive to enable a deserializing program to identify and handle data created by earlier program versions. The class schema number must not be –1.

Use the IMPLEMENT_SERIAL macro in a .cpp module; then link the resulting object code only once.

You can use the AFX_API macro to automatically export the CArchive extraction operator for classes that use the DECLARE_SERIAL and IMPLEMENT_SERIAL macros. Bracket the class declarations (located in the .h file) with the following code:

#undef AFX_API
#define AFX_API AFX_EXT_CLASS

// <your class declarations here>

#undef AFX_API
#define AFX_API

For more information, see the CObject Class Topics.

IMPLEMENT_SERIAL(CAge, CObject, VERSIONABLE_SCHEMA | 2)

Header: afx.h

Community Additions

ADD
Show:
© 2015 Microsoft