Is there any way to retrieve information from a CArchive file if we don't know what type of objects are stored in the CArchive file?
I want to know in what format information is stored in a CArchive file.
Please help me out in this.
Is there any way to retrieve information from a CArchive file if we don't know what type of objects are stored in the CArchive file?
I want to know in what format information is stored in a CArchive file.
Please help me out in this.
Copyright © 2021 Jogjafile Inc.
The file format is documented under TN002: Persistent Object Data Format. While that explains how objects are identified in the data stream for deserialization, the actual logic to dump data into the
CArchiveand to read it back is at the discretion of theCObject-derived class implementation for classes that use theDECLARE_SERIALandIMPLEMENT_SERIALmacros.Without the actual (de-)serialization code there's little you can do with a binary
CArchivestream, unless the implementation that produced it uses the standard serialization methods throughout, allowing you to guess the data types stored.Unlike JSON or XML, though, a
CArchive's serialized data isn't self-describing. Even when you know the type of any given piece of data, there's nothing in the file that carries any semantic information.