[Message Deleted]
-
the list control must know the string to put in the list control, if you need to put an integer or a double, etc. then you should format it first. i show alot of integers in some of my lists, so i wrote a simple int to string function.. something like:
CString CCommonFunctions::toString(int nVal)
{
CString strTemp;
strTemp.Format("%i", nVal);
return strTemp;
}that way when you add your value to the list control you can just use
m_lstMyList.InsertItem(0, CCommonFunctions::toString(nMyInt));
also remember you can set a pointer to each object incase you need to associate each item with a custom object
CMyObject* myObj = new CMyObject("blah",1,20);
m_lstMyList.InsertItem(nPos, CCommonFunctions::toString(myObj->m_nX));
m_lstMyList.SetItemData(nPos, (DWORD) myObj);then later use
GetItemData()
CMyObject* myObj = NULL;
int nPos = m_lstMyList.GetSelectionMark();
if (nPos != -1)
{
myObj = m_lstMyList.GetItemData(nPos);
}-dz