Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

How do I....

Posted on 2000-03-14
1
169 Views
Last Modified: 2013-11-20
I have a dialog box (DialogB) that prompts the users for some information that needs to be processed by the dialog box (DialogA) that opened it.  Now box dialog boxes are Modal, how can I get the info from DialogB into a var from DialogA??
0
Comment
Question by:meetze
1 Comment
 
LVL 4

Accepted Solution

by:
pagladasu earned 100 total points
ID: 2617736
Suppose DialogB has an edit control for taking in username. Assume that its id is IDC_EDITUSERNAME. Use classwizard to associate a member variable with it. Say it is called m_username.
Override the OnOK member function of this dialog class as follows:
UpdateData(TRUE);
CDialog::OnOK();
Open the DialogB from a funtion of DialogA as follows:
    CDialogB mldg;
    CString username;
    int response=mdlg.DoModal();
    if(response==IDOK){
       username=mdlg.m_username;
    }

Thats about all. Hope this helps.
pagladasu
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Prevent this page from creating additional dialogs. 3 614
only14 challenge 19 81
twoTwo  challenge 35 107
abstract class with all non abstract mentods 6 80
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question