MFC list controls accept plastic data.
CString GetItemText( int nItem,int nSubItem)const; This returns a CString, and you assign it to int. Of course, there is an error. Of course, the contents in the list box are all text types, and there is no int type. You can use _ttoi or _ttol to convert TCHAR data into integers.