Hello. I am programming an application in which a main dialog needs to
know the data in other dialogs (opened by clicking buttons in the main
dialog). There are a lot of CEdit's and doing that via Class Wizard
(with member variables for each dialog class) is quite tiring.
If there were just one dialog I would get data in a loop:
void MainDialog::f() {
...
for(int id = IDC_FIRSTID; id<=IDC_LASTID; id++)
this->GetDlgItemText(id,str);
...
}
But the CEdit's are in other dialogs, so their data is lost when you
close them. That is, I can't do the following:
void MainDialog::f() {
...
for(int id = IDC_FIRST_ID_DLG1; id<=IDC_LAST_ID_DLG1; id++)
dlg1.GetDlgItemText(id,str);
...
}
How can I do that without using member variables?
Thanks.