BUG: CMemFile File Size Limited to 64K

Last reviewed: July 22, 1997
Article ID: Q113586
1.00 1.50 1.51 1.52 WINDOWS kbprg kbbuglist

The information in this article applies to:

  • The Microsoft Foundation Classes (MFC), included with: Microsoft Visual C++ for Windows, version 1.0, 1.5, 1.51 and 1.52

SYMPTOMS

With version 2.0 of the Microsoft Foundation Classes (MFC), the size of the buffer used by CMemFile and classes derived from CMemFile is limited to 64K.

CAUSE

Although the memory for the file is allocated using GlobalAlloc and is allowed to grow, the member variable that contains the buffer size is of type UINT, limiting the total file size to 64K.

RESOLUTION

Although internal use of CMemFile and CMemFile-derived classes cannot be changed without modifying the MFC sources, the user may derive a class from CMemFile and create memory allocation functions and a member variable for a buffer size with a higher limit.

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available.


Additional reference words: 1.00 1.50 2.00 2.50 in-memory RAM
KBCategory: kbprg kbbuglist
KBSubcategory: MfcFileIO
Keywords : kb16bitonly
Technology : kbMfc


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: July 22, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.