Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

CArchive::SetObjectSchema

Call this member function to set the object schema stored in the archive object to nSchema.

void SetObjectSchema(
   UINT nSchema 
);

Parameters

nSchema
Specifies the object's schema.

Remarks

The next call to GetObjectSchema will return the value stored in nSchema.

Use SetObjectSchema for advanced versioning; for example, when you want to force a particular version to be read in a Serialize function of a derived class.

Example

CFile myFile("myfile.dat", CFile::modeCreate | CFile::modeRead);
CArchive ar(&myFile, CArchive::load);

// Set schema to 2 and verify.
ar.SetObjectSchema(2);
ASSERT(ar.GetObjectSchema() == 2);

See Also

CArchive Overview | Class Members | Hierarchy Chart | CArchive::GetObjectSchema

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.