CComboBox::GetItemDataPtr

void* GetItemDataPtr( int nIndex ) const;

Return Value

Retrieves a pointer, or –1 if an error occurs.

Parameters

nIndex

Contains the zero-based index of an item in the combo box’s list box.

Remarks

Retrieves the application-supplied 32-bit value associated with the specified combo-box item as a pointer (void*).

Example

// The pointer to my combo box.
extern CComboBox* pmyComboBox;
extern LPVOID    lpmyPtr;

// Check all the items in the combo box; if an item's
// data pointer is equal to my pointer then reset it to NULL.
for (int i=0;i < pmyComboBox->GetCount();i++)
{
   if (pmyComboBox->GetItemDataPtr(i) == lpmyPtr)
   {
      pmyComboBox->SetItemDataPtr(i, NULL);
   }
}

CComboBox OverviewClass MembersHierarchy Chart

See Also   CComboBox::SetItemDataPtr, CComboBox::GetItemData, CComboBox::SetItemData, CB_GETITEMDATA