Solved

Showing dialogs. Very, very easy.

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

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
bobThere java chalenge 45 85
Macro to save highlighted rows as a separate file 5 38
Expand data scrubbing tool 13 31
Change to event 1 75
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

743 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

12 Experts available now in Live!

Get 1:1 Help Now