[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How do I....

Posted on 2000-03-14
1
Medium Priority
?
185 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 400 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
Ready to get certified? Check out some courses that help you prepare for third-party exams.
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.
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

834 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