Click to See Complete Forum and Search --> : Need your help. Extended Combo Box


parragain
May 16th, 1999, 11:02 PM
I have attached a member variable (int m_iInterval) to my extended Combo Box. The user can choose values in the box. After entering "OK", I display the result in a List Box in my main window. The problem is that this result is '0' if the user has choosen the first value in the extended combo box (20), '1' for the second value of the extended combo box, '2' for the third.....
My code is the following :
if(m_dIntervalDlg.DoModal() == IDOK)
{
//CIntervalDlg m_dIntervalDlg ;//m_dIntervalDlg is a variable declared in the main dlg class
CString stmp;
int Interval;
Interval=m_dIntervalDlg.m_iInterval;
stmp.Format("Timer Interval: %05d \n", Interval);
m_cStatusList.AddString(stmp);
....

How can I display the correct value ?

Thanks a lot.

May 17th, 1999, 01:59 AM
what you're getting is the *index* of the combo box item the user selected, i assume you want to get the actual display value?

if so, then go to class wiward, delete your existing m_iInterval var. and create a new one but this time select CString as the var. type.