Solved

Second call to DoModal() hangs

Posted on 1997-10-07
2
379 Views
Last Modified: 2013-11-20
I am using VC++ 5.0.  I am trying to make the following
calls:

MyFunc()
{
   CDialog1 dialog1;
   CDialog2 dialog2;

   dialog1.DoModal();
   dialog2.DoModal();
}

The program hangs when it calls dialog2.DoModal().
Dialog1 simply consists of a single button which
when pushed, I call CDialog::OnOK();

Is there a problem calling two DoModals() in a row?

Thanks,
Mark Kaplan
kaplan@dspfx.com

0
Comment
Question by:kaplan1
2 Comments
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 100 total points
Comment Utility
There shouldn't be any problems. I've done this many times myself. The only thing I can think of would be to make sure the first dialog does not corrupt the stack. Check your pointers and any arrays you may have. Also if your first dialog has any data members used in the DDX macros, make sure they are the right types. You may also want to simplify your first dialog to as little as possible.

Good luck!
0
 
LVL 10

Expert Comment

by:RONSLOW
Comment Utility
Does it hang when you remove the second dialog?

Have you run this with the debugger to find out where it hangs?

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

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

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

16 Experts available now in Live!

Get 1:1 Help Now