how to transfer data betwn two dialogs
-
i am one project where i have to transfer controls data between two dialog. i can manage to send the data from ist dialog to second like this... CMyDialog2 m_mydlg2; m_mydlg2.myvariable2=myvariable1; m_mydialog2.DoModal(); this works correctly but now i need to get the data of second dialog in first one after closing the second dialog can anyone help me for that thax
-
i am one project where i have to transfer controls data between two dialog. i can manage to send the data from ist dialog to second like this... CMyDialog2 m_mydlg2; m_mydlg2.myvariable2=myvariable1; m_mydialog2.DoModal(); this works correctly but now i need to get the data of second dialog in first one after closing the second dialog can anyone help me for that thax
CMyDialog2 m_mydlg2; m_mydlg2.myvariable2=myvariable1; int nRet = m_mydialog2.DoModal(); if(nRet == IDOK) // if okay was clicked get the data from the dialog { myvariable1 = m_mydialog2.myvariable2; // get the variable back out of the dialog } Michael
-
i am one project where i have to transfer controls data between two dialog. i can manage to send the data from ist dialog to second like this... CMyDialog2 m_mydlg2; m_mydlg2.myvariable2=myvariable1; m_mydialog2.DoModal(); this works correctly but now i need to get the data of second dialog in first one after closing the second dialog can anyone help me for that thax
Use Michaels's suggestion, or pass a pointer to the second dialog, as in:
m_mydlg2.myptrvariable2 = &myvariable1;
Now when
myptrvariable2
is modified in the second dialog, the first dialog will automatically "see" the change(s).
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen