Solved

Second call to DoModal() hangs

Posted on 1997-10-07
2
438 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
[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
2 Comments
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 100 total points
ID: 1307655
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
ID: 1307656
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

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…

691 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