FIX: Memory Leak in CVBControl::AddItem()

Last reviewed: September 18, 1997
Article ID: Q110952
1.00 WINDOWS kbprg kbfixlist kbbuglist

The information in this article applies to:

  • The Microsoft Foundation Classes (MFC) included with:

        - Microsoft Visual C++ for Windows, version 1.0
    

SYMPTOMS

When using CVBControl::AddItem() to add additional items to a VBX control, you may notice a memory leak of 500-1000 bytes per call.

CAUSE

The Microsoft Foundation Class (MFC) Library provides an emulation of Visual Basic to allow VBX controls to be used in a Windows-based application written in C++. The emulation of the standard AddItem() method in MFC 2.0 does not release an unneeded HSZ (handle to zero terminated string) when adding an item to a VBX control.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Foundation Classes for Windows, version 2.0. This problem was corrected in Microsoft Foundation Classes for Windows version 2.5, which is included with Microsoft Visual C++, version 1.5.


Additional reference words: 1.00 2.00 memory leak VBX grid
addItem CVBControl
KBCategory: kbprg kbfixlist kbbuglist
KBSubcategory: MfcVBX
Keywords : kb16bitonly MfcVBX kbbuglist kbfixlist kbprg
Technology : kbMfc
Version : 1.00
Platform : WINDOWS
Solution Type : kbfix


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: September 18, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.