Is there any way to get a CString from a modal dialog box? First off, how do you intialize the modal dialog box. In case you haven't yet picked up, this is for MFC, more over, an SDI app.
Thanks for any help.
Is there any way to get a CString from a modal dialog box? First off, how do you intialize the modal dialog box. In case you haven't yet picked up, this is for MFC, more over, an SDI app.
Thanks for any help.
You could try using DDX to retrieve the value from the dialog. If you go to the actual dialog in the resource folder and then open up class wizard you select the ID of the editbox on the dialog where your CString value will be entered by the user and you can then add a CString member variable that would hold the value entered in the dialog box. Once the dialog box is displayed, the value entered, and the OK button clicked, DDX will ensure that the value entered will be sent to the corresponding variable in your dialog class.
You must remember to create an instance of your dialog and then call on the domodal function to display it. If the dialog is displayed in response to a menu button being clicked you would have to place the code in the message handler for that menu button.
For instance if the dialog class is called CDlg, we would have:
CDlg exampledlg;
exampledlg.DoModal();
For more detail you can check the MSDN library it has some really useful information. Hope this helps.
Tesita