关于CListCtrl如何获取每项的文字呢??
是用GetItemText函数吗?这个函数的参数都是什么含义呢?能给举个例子吗?
int GetItemText( int nItem, int nSubItem, LPTSTR lpszText, int nLen ) const;
CString GetItemText( int nItem, int nSubItem ) const;
Return Value
The version returning int returns the length of the retrieved string.
The version returning a CString returns the item text.
Parameters
nItem
The index of the item whose text is to be retrieved.
nSubItem
Specifies the subitem whose text is to be retrieved.
lpszText
Pointer to a string that is to receive the item text.
nLen
Length of the buffer pointed to by lpszText.
一个CListCtrl有几列,每列又有几项,那么第几列,这里就是用nItem表示,第几项,这里就是用nSubItem表示,lpszText就是保存该位置的字符串的,nlen就是表示拷贝字符串的长度的。
比如这样的结构:
w 90 80
a 80 70
c 60 60
CString str;
GetItemText(0,0,str,10);
获得的就是w