Solved

Working with differente dialogs

Posted on 2000-03-30
3
177 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

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

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
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.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

867 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

16 Experts available now in Live!

Get 1:1 Help Now