Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CArchive, Serializing & Schema

Status
Not open for further replies.

JTeagle

Programmer
May 30, 2000
49
GB
I have a situation where I need to serialize several parts of a document-derived class. Because the standard doc loading / saving mechanism is not quite what I need, I have to construct the CArchive manually. All the serialization is working fine in itself, but the one thing I can't seem to get to work now I need it is the schema business.

My doc-derived class uses IMPLEMENT_SERIAL() with the current schema number correctly. I create the archive correctly and then start serializing out (when saving, this is)... but for some reason it never saves the schema in the binary file. I tried SetObjectSchema() immediately after constructing the CArchive, which certainly sets the internal schema value... but that never gets written to file.

I looked at the code for CDocument where it calls our overriden Serialize() to see how it did it - from that I see it sets the archive's m_pDocument and another member. So I did this also... STILL doesn't save the schema in the file.

Since CDocument::Serialize() does not do anything, calling the base class has no effect.

Any clues as to what I'm missing? Otherwise I'll have to do the schema bit myself. But I'd rather use the built-in stuff as much as possible.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top