Hello,
I have an application that when the user presses a button a dialog box pops up. From that dialog box another button can be pushed that brings up a CFileDialog box that lets the user select multiplie files. The selected files are put into a CListBox control. That works fine.
My problem is when the user hits the ok button on the original dialog box and goes back to the main window. I try to access the listbox items, but it is always empty. If I put a button on the dialog box and access the listbox from there everything is fine. All of my other controls work fine, except for this one.
So, basically this is what I've got:
CMyDialog dialog;
CString temp;
if (dialog.DoModal() == IDCANCEL)
return;
else
{
some_function(dialog.m_editValue); // this works fine
some_function2.(dialog.m_listbox.GetCount());
// GetCount always returns 0
// even though there are items in the list
}
Does anyone have any ideas? I'm totally confused, but I'm almost certain I'm missing something simple. Thanks for any help.
Thanks,
Nick
I have an application that when the user presses a button a dialog box pops up. From that dialog box another button can be pushed that brings up a CFileDialog box that lets the user select multiplie files. The selected files are put into a CListBox control. That works fine.
My problem is when the user hits the ok button on the original dialog box and goes back to the main window. I try to access the listbox items, but it is always empty. If I put a button on the dialog box and access the listbox from there everything is fine. All of my other controls work fine, except for this one.
So, basically this is what I've got:
CMyDialog dialog;
CString temp;
if (dialog.DoModal() == IDCANCEL)
return;
else
{
some_function(dialog.m_editValue); // this works fine
some_function2.(dialog.m_listbox.GetCount());
// GetCount always returns 0
// even though there are items in the list
}
Does anyone have any ideas? I'm totally confused, but I'm almost certain I'm missing something simple. Thanks for any help.
Thanks,
Nick