Solved

Showing dialogs. Very, very easy.

Posted on 2000-03-27
5
182 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

Industry Leaders: 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
Installing Microsoft R server on REDHAT or SUSE Linux 4 152
iSeries FTP Exit Program 8 163
ShiftLeft challenge 21 89
Adjust the codes 3 33
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
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.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

733 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