FIX: Memory Leak in CVBControl::AddItem()

ID: Q110952

1.00 WINDOWS kbprg kbfixlist kbbuglist

The information in this article applies to:

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 kbMFC kbVBX kbVC kbbuglist kbfixlist
Version           : 1.00
Platform          : WINDOWS
Solution Type     : kbfix

Last Reviewed: September 21, 1997