The information in this article applies to:
SYMPTOMS
A CCheckListBox with the LBS_SORT style incorrectly copies the item data.
Different strings in the listbox point to the same item data object. In
debug mode using Visual C++ 4.0 and 4.1, this behavior will ASSERT in
DBGHEAP.C as _free_dbg() is called on the same memory block multiple times.
CAUSEThis is a problem in Win32s with owner-draw listboxes that have the LBS_HASSTRINGS and LBS_SORT listbox styles. CCheckListBox is an owner-draw listbox that uses LBS_OWNERDRAWFIXED or LBS_OWNERDRAWVARIABLE with LBS_HASSTRINGS. CCheckListBox uses the item data to maintain the check state information for each item. RESOLUTION
To work around this behavior, avoid the LBS_SORT style or use
InsertString() instead of AddString(). InsertString() does not cause a
LBS_SORT list to be sorted. STATUSThis behavior is by design. Additional query words: 2.00 2.10 2.20 4.00 4.10 CListBox list box
Keywords : kbnokeyword kbMFC kbVC kbx86 |
Last Reviewed: July 22, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |