BUG: CArchiveException for Read-only and Write-only FilesLast reviewed: July 7, 1997Article ID: Q87554 |
The information in this article applies to:
SYMPTOMSThe CArchiveExceptions for read-only and write-only archives are not thrown by the Microsoft Foundation Class Library. This condition can be caught by checking for an access denied CFileException.
CAUSEThis is an oversight of the MFC libraries. The CArchive class does not utilize a try/catch block in its member functions that actually perform the serialization. Thus, a CArchiveException will never be thrown for read-only and write-only archives.
RESOLUTIONTo test for this condition, look for a CFileException with an m_cause value of CFileException::accessDenied.
STATUSMicrosoft has confirmed this to be a problem in the versions of the Microsoft Foundation Classes listed above. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.
MORE INFORMATIONThe CArchiveException class is used to handle exceptions that happen when using the CArchive class. The cause of the CArchiveException can be found by checking the m_cause data member of CArchiveException. Two of the values listed for m_cause are CArchiveException::readOnly and CArchiveException::writeOnly. For more information, refer to the Visual C++ Books Online topics for CArchive and CArchiveException. |
Keywords : MfcFileIO
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |