Solved

Showing dialogs. Very, very easy.

Posted on 2000-03-27
5
183 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
[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
  • 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

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

Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

705 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