Solved

Working with differente dialogs

Posted on 2000-03-30
3
178 Views
Last Modified: 2013-11-20
Hello.

I have a main dialog (named fhgdlg). When the user clicks on a button of this main dialog, then a new dialog appears (named DlgNewSC). In this new dialog the user can type some information which would be used to update some variables defined in the first dialog, but when I try to relate both dialogs I always get "undeclared identifier", although I have included the include lines in both dialog codes:

#include "DlgNewSC.h"
#include "fhgDlg.h"

So, wheres the problem??
0
Comment
Question by:javigil1
3 Comments
 
LVL 1

Accepted Solution

by:
RAVID earned 75 total points
ID: 2668593
Hi,

Say U have Dlg1 and Dlg2. Dlg2 will be pop up on click of some button on Dlg1.
And Dlg2 has a string m_name. Now In Dlg1 .cpp u include the header for Dlg2 and do like this

Dlg2 dlg;
if(Dlg2.DoModal() == IDOK)
{
  Dlg2.m_name will give u the updated   string.
}

Hope this helps.
0
 

Author Comment

by:javigil1
ID: 2668768
Yes that´s almost right:
It should be

 if(dlg.DoModal()==IDOK)
....
 and then use dlg.m_name

Anyway, thanks for your answer. Enjoy the points.
0
 
LVL 3

Expert Comment

by:V_Bapat
ID: 2668788
Yes. You have to include both the files.

It is not clear from you post where are you getting the error and what are you doing. To get a pointer to the first dialog, you need to do this:

fhgdlg* pDlgMain= (fhgdlg*)GetParent();

More details would certainly be useful.

Vicky
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Expand macro to include alternate header placement and naming 5 71
Unix / Linux grid computing 5 156
notReplace  challenge 53 125
centeredAverage challenge 8 163
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 …
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…
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.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

776 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