Solved

How do I....

Posted on 2000-03-14
1
163 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
Comment Utility
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Login Script to Copy Folders 12 20
maven archtype selection in eclipse 1 51
zeroMAx challenge 20 76
Fibonacci challenge 11 81
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

762 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

11 Experts available now in Live!

Get 1:1 Help Now