BUG: CMemFile File Size Limited to 64K

ID: Q113586

1.00 1.50 1.51 1.52 WINDOWS kbprg kbbuglist

The information in this article applies to:

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

Last Reviewed: July 23, 1997