Called if an exception is thrown (typically a CFileException or CArchiveException) while saving or loading the document.

virtual void ReportSaveLoadException( 
   LPCTSTR lpszPathName, 
   CException* e, 
   BOOL bSaving, 
   UINT nIDPDefault  


  • lpszPathName
    Points to name of document that was being saved or loaded.

  • e
    Points to the exception that was thrown. May be NULL.

  • bSaving
    Flag indicating what operation was in progress; nonzero if the document was being saved, 0 if the document was being loaded.

  • nIDPDefault
    Identifier of the error message to be displayed if the function does not specify a more specific one.


The default implementation examines the exception object and looks for an error message that specifically describes the cause. If a specific message is not found or if e is NULL, the general message specified by the nIDPDefault parameter is used. The function then displays a message box containing the error message. Override this function if you want to provide additional, customized failure messages. This is an advanced overridable.


Header: afxwin.h

See Also


CDocument Class

Hierarchy Chart



CFileException Class

CArchiveException Class

Other Resources

CDocument Members