|
-
April 15th, 1999, 03:19 AM
#1
Inserting an Integer into a list control
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
-
April 15th, 1999, 04:45 AM
#2
Re: Inserting an Integer into a list control
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|