Solved

Should All Dialog Boxes be in the same file?

Posted on 1998-08-06
3
231 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
[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
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
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 learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

623 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