Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic


Call this function to close the archive without throwing an exception.

void Abort ( );


The CArchive destructor will normally call Close, which will flush any data that has not been saved to the associated CFile object. This can cause exceptions.

When catching these exceptions, it is a good idea to use Abort, so that destructing the CArchive object doesn't cause further exceptions. When handling exceptions, CArchive::Abort will not throw an exception on failures because, unlike CArchive::Close, Abort ignores failures.

If you used new to allocate the CArchive object on the heap, then you must delete it after closing the file.


See the example for CArchive::WriteClass.

See Also

CArchive Overview | Class Members | Hierarchy Chart | CArchive::Close | CFile::Close

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
© 2014 Microsoft. All rights reserved.