class CGXDocument : public CDocument
All documents that are used by workbook classes should be derived from CGXDocument. The actual serialization code should be copied over to WorkBookSerialize. Change the existing Serialize handler to simply call the base class (or remove the handler itself). This is the most important change when using this class when compared to using CGXDocument.
Another important detail is that CGXDocuments always have a ‘Primary document’. This document is the controlling document as far as serialization is concerned. All actual persistence calls will be translated into calls on this instance rather than the individual instances of the documents within a frame window handling these.
#include <gxdoc.h>