Solved

How do I....

Posted on 2000-03-14
1
166 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ASCII Non-Printable characters/codes and their HTML equivalents 6 105
Looking for a specific application/software 2 104
ShiftLeft challenge 21 76
post4 challenge 28 93
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: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

920 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now