Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize


Retrieves the text of a list view item or subitem.

int GetItemText(
   int nItem,
   int nSubItem,
   LPTSTR lpszText,
   int nLen 
) const;
CString GetItemText(
   int nItem,
   int nSubItem 
) const;


The index of the item whose text is to be retrieved.
Specifies the subitem whose text is to be retrieved.
Pointer to a string that is to receive the item text.
Length of the buffer pointed to by lpszText.

Return Value

The version returning int returns the length of the retrieved string.

The version returning a CString returns the item text.


If nSubItem is zero, this function retrieves the item label; if nSubItem is nonzero, it retrieves the text of the subitem. For more information on the subitem argument, see the discussion of the LVITEM structure in the Platform SDK.

See Also

CListCtrl Overview | Class Members | Hierarchy Chart | CListCtrl::GetItem

© 2015 Microsoft