Solved

Should All Dialog Boxes be in the same file?

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
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.

739 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