Solved

Working with differente dialogs

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

Technology Partners: 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

Suggested Solutions

Title # Comments Views Activity
Windows Drag & Drop Location 2 112
Path of Workbook 3 87
Remove Password Protection from pdf (with password) using an command line executable 5 81
Problem to App source 6 93
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 …
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.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

749 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