Peter,
>>
I have a class within an application which I need to update. The
class does not have a user version number implemented as it was
never envisaged that the class would change, so I need a method of
detecting if the class serialized from the disk is the old schema
number or the new one. KBase article Q108370 (Example A)
shows some example code for handling this situation, but I cannot
get it to work as I cannot seem to trap the
CArchiveException::badSchema within the classes 'Serialize'
routine.
<<
Is the exception being thrown but you are somehow not catching it?
If you could post the TRY / CATCH block of your code that might
give me an idea why the exception wasn't being caught.
Thanks,
Tarn Faulkner
Microsoft Developer Support
Instead of messing around the the schema's we just always write a WORD as the
first thing in each objects Serialize. This way our objects are self-updating.
Also this is great because if we get a corrupt file and the WORD isn't valid we
use AfxThrowFileException to stop the process.