Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Working with differente dialogs

Posted on 2000-03-30
3
Medium Priority
?
188 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 1

Accepted Solution

by:
RAVID earned 225 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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: 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.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

596 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