The information in this article applies to:
SYMPTOMSIf a CArchive object is used with a user-defined buffer and the buffer is destroyed before the CArchive object has been destroyed, an assertion failure might occur. The message in the output window would be similar to:
-or- CAUSEThe CArchive destructor can be found in the <MSVC install>\MFC\SRC directory in the file ARCCORE.CPP. The function is implemented as follows:
If a user-defined buffer is used for the archive (by passing it in as the
lpBuf parameter to the CArchive constructor), it should be valid to call
CArchive::Close on the archive, and then destroy the buffer before
destroying the CArchive object. However, the above ASSERT will be executed
when the CArchive object is destroyed whether the user-supplied buffer has
been destroyed or not.
If the buffer is destroyed before the CArchive object is destroyed, m_lpBufStart might no longer point to a valid memory address. By default it points to the address of the user-supplied buffer. RESOLUTION
STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This bug was corrected in Microsoft Visual C++ for Windows, version 1.52 and in Microsoft Visual C++, 32-bit Edition, version 2.1. Additional query words: 1.00 1.50 1.51 2.00 2.50 2.51 2.10 3.00 3.10 globalalloc load store
Keywords : kbcode kbnokeyword kbFileIO kbMFC kbVC |
Last Reviewed: February 2, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |