Click to See Complete Forum and Search --> : Inserting an Integer into a list control


April 15th, 1999, 03:19 AM
I am having some difficulty inserting an int into a list control rather than a CString. I cant seem to find a function that will do it for me. What I have so far is:

CStrint m_blah, m_blahblah, m_blahblahblah;

item = m_list_ctrl.InsertItem(0, m_blah);

m_list_ctrl.SetItemText(item,1,m_blahblah);

m_list_ctrl.SetItemText(item,2,m_blahblahblah);



I am trying to do something following on from the above like

int number;

m_list_ctrl.InsertItemText(item,3,number);



Obviously this doesn't work.
Any held would be nice, thanks.
Thomas

Dave Lorde
April 15th, 1999, 04:45 AM
You must convert the number to a string representation to display it:

int number(5);
CString numberStr;
numberStr.Format("%d", number);
m_list_ctrl.SetItemText(item,1,number);

Dave