The object is saved with no problem into the required file. However, when I try to open it, i get a fatal error message. I began debugging it to trace it to the exact line, but the compiler compiles comfortably upto the line just before the cArch1.Close() line and exits the method. It then proceed to this snippet from a "Wincore.cpp":
Re: Object serialization problem: opening and reading a saved object.
You might want to show the code where you open the file. You also may want to try to catch the exception yourself and see what the error actually is.
Also, never close the CArchive inside a serialize function. That's going to cause problems if you have more than one object, and that may well be your problem here.
Re: Object serialization problem: opening and reading a saved object.
Originally Posted by GCDEF
I wouldn't try to create two CArchives on the same file.
I see. So how could I initiate the open and load routine? I'm trying to get CArchive::IsStoring() to be false and CArchive::IsLoading() to be true. There is no function to set this change.
Bookmarks