Solved

Working with differente dialogs

Posted on 2000-03-30
3
176 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Show shut-down message as Windows 8 shuts down. 9 74
only14 challenge 19 63
noX challenge 17 75
Unix Command -- Challenging  question 7 79
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…
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.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

771 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

15 Experts available now in Live!

Get 1:1 Help Now