## BUG: CMemFile File Size Limited to 64K

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
Issue type :
Technology : kbAudDeveloper kbMFC

Last Reviewed: December 22, 1999 © 2001 Microsoft Corporation. All rights reserved. Terms of Use.