CListBox::GetItemDataPtr
Retrieves the application-supplied 32-bit value associated with the specified list-box item as a pointer (void*).
void* GetItemDataPtr(
int nIndex
) const;
Параметры
- nIndex
Specifies the zero-based index of the item in the list box.
Возвращаемое значение
Retrieves a pointer, or –1 if an error occurs.
Пример
LPVOID lpmyPtr = pParentWnd;
// Check all the items in the list box; if an item's
// data pointer is equal to my pointer then reset it to NULL.
for (int i=0; i < m_myListBox.GetCount(); i++)
{
if (m_myListBox.GetItemDataPtr(i) == lpmyPtr)
{
m_myListBox.SetItemDataPtr(i, NULL);
}
}
Требования
Header: afxwin.h