Passing data between a popup dialog and SDI
-
Hi, Does anyone know how do i pass data bettwen a popup dialog and single documnet interface with splitter window? In my mainframe of SDI i wrote TestDlg* dlg = new TestDlg; dlg->DoModal(); From SDI how do i retrive data from the dialog box? Thanks
-
Hi, Does anyone know how do i pass data bettwen a popup dialog and single documnet interface with splitter window? In my mainframe of SDI i wrote TestDlg* dlg = new TestDlg; dlg->DoModal(); From SDI how do i retrive data from the dialog box? Thanks
MaxiFire wrote: From SDI how do i retrive data from the dialog box? You can get the dialog data via its member variables. I see you are also creating the dialog dynamically, so you need to do this before deleting the dialog. For Example: Lets say your dialog retrieves some text and a number from the user. You need to instantiate the dialog, the user will fill in the information, then the SDI app will get this when the dialog is closed. My (untested) code would probably look like:
int nNumber; CString strText; TestDlg* dlg = NULL; **//Create new dialog** dlg = new TestDlg; **// // If the user clicked the OK button // retrieve the input information //** if( dlg.DoModal() == IDOK ) { strText = dlg->m_strText; nNumber = dlg->m_nNumber; } **// clean up** delete dlg;
**I Dream of Absolute Zero
**