int GetItemText( int nItem, int nSubItem, LPTSTR lpszText, int nLen ) const;CString GetItemText( int nItem, int nSubItem ) const;Return ValueThe version returning int returns the length of the retrieved string.The version returning a CString returns the item text.ParametersnItemThe index of the item whose text is to be retrieved.nSubItemSpecifies the subitem whose text is to be retrieved.lpszTextPointer to a string that is to receive the item text.nLenLength of the buffer pointed to by lpszText.ResRetrieves the text of a list view item or subitem. 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 theLVITEM structure in the Platform SDK.
//char str[256]={0};
CString str = "";
CListCtrl *pListCtrl = (CListCtrl*)CWnd::FromHandle(hchildWnd_REC); int nIndex = pListCtrl->GetItemCount();
//int nlen = pListCtrl->GetHeaderCtrl()->GetItemCount();
str_id.Format("%d", nIndex);
//pList->GetText(nIndex1,str_name);
//MessageBox(str_id);
for(int i=0;i<nIndex;i++)
{
str = pListCtrl->GetItemText(i,0);
emun_id2 = emun_id2 + str_id + " " + str +"\n";
}