Solved

Showing dialogs. Very, very easy.

Posted on 2000-03-27
5
180 Views
Last Modified: 2013-11-20
I have made a dialog with the resource editor.
What code do I have to add in order to show it? (for instance, when the user clicks a button in another dialog)
0
Comment
Question by:caiman23
  • 2
  • 2
5 Comments
 

Accepted Solution

by:
kakamna earned 35 total points
ID: 2660314
Declare an object of type the name of your dialog class.
Double click on the dialog in the resource editor this will ask you to create a new class Named it as CMyDialog . click yes
Then When the user click in another dialog on a button
In the eaven handler of that butoon
Write

CMyDialg dlg;
dlg.DoModal();

Thsi will Bring up the dialog box.
0
 

Author Comment

by:caiman23
ID: 2660684
So, I create a dialog and I give the name CDlgNewSC to the new class.
I have another dialog, and I want to open the new one by clicking on a button named NewSC (in the old dialog). So I have this:

void CFhgDlg::OnNewSC()
//CFhgDlg: old dialog
{
      CDlgNewSC dlg;
      dlg.DoModal();
}


But of course I get the message "CDlgNewSC undeclared identifier", because both dialogs come from CDialog, but they dont know each other...
What can I do?
0
 

Author Comment

by:caiman23
ID: 2660746
So, I create a dialog and I give the name CDlgNewSC to the new class.
I have another dialog, and I want to open the new one by clicking on a button named NewSC (in the old dialog). So I have this:

void CFhgDlg::OnNewSC()
//CFhgDlg: old dialog
{
      CDlgNewSC dlg;
      dlg.DoModal();
}


But of course I get the message "CDlgNewSC undeclared identifier", because both dialogs come from CDialog, but they dont know each other...
What can I do?
0
 
LVL 3

Expert Comment

by:ghimireniraj
ID: 2660789
//////////////////////////
void CFhgDlg::OnNewSC()
//CFhgDlg: old dialog
{
CDlgNewSC dlg;
dlg.DoModal();
}
////////////////////////////


In whatever file you have the code abhove include the header file  of the file where CDlgNewSC  class is defined.

ie

#include "DlgNewSC.h"


You are done

niraj





0
 

Expert Comment

by:kakamna
ID: 2661284
ghimireniraj is rite.
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

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…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

813 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

11 Experts available now in Live!

Get 1:1 Help Now