Solved

Should All Dialog Boxes be in the same file?

Posted on 1998-08-06
3
187 Views
Last Modified: 2010-04-02
Have made several dialog boxes in different files and I am trying to connect them together. One dialog box is a menu in which I want to call other dialog boxes. How do I open one dialog box from another?
0
Comment
Question by:troy24
3 Comments
 
LVL 2

Accepted Solution

by:
jstolan earned 50 total points
ID: 1169544
No don't put them in the same file.  This is legal, but it's much harder to keep track of them.

Each dialog box should have an associated .h file.  Simply add that to the list of include files for functions that need to access them.  Here is a snippet that assumes you're using classes derived from CDialog for your code.

In dialog box 2 which calls dialog box 1 do this:

#include <stdafx.h>

// other includes

#include "Dialog2.h"


void CDialog1::CallingFunction()
{
    CDialog2 myDlg2;
    myDlg2.DoModal();
}
0
 
LVL 22

Expert Comment

by:nietod
ID: 1169545
>> No don't put them in the same file.  This is legal, but it's much harder to keep track of them
That is just a matter of opinion.  You should organize them however is convenient for your project.  I have a project with 100s of dialogs.  I would not like to have each on in a seperate file.  
0
 

Author Comment

by:troy24
ID: 1169546
Thanks for the Help
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

Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

747 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

17 Experts available now in Live!

Get 1:1 Help Now