CComboBox::CompareItem

virtual int CompareItem( LPCOMPAREITEMSTRUCT lpCompareItemStruct );

Return Value

Indicates the relative position of the two items described in the COMPAREITEMSTRUCT structure. It can be any of the following values:

Value Meaning
– 1 Item 1 sorts before item 2.
0 Item 1 and item 2 sort the same.
1 Item 1 sorts after item 2.

See CWnd::OnCompareItem for a description of COMPAREITEMSTRUCT.

Parameters

lpCompareItemStruct

A long pointer to a COMPAREITEMSTRUCT structure.

Remarks

Called by the framework to determine the relative position of a new item in the list-box portion of a sorted owner-draw combo box. By default, this member function does nothing. If you create an owner-draw combo box with the LBS_SORT style, you must override this member function to assist the framework in sorting new items added to the list box.

CComboBox OverviewClass MembersHierarchy Chart

See Also   WM_COMPAREITEM, CComboBox::DrawItem, CComboBox::MeasureItem, CComboBox::DeleteItem