?
Solved

Second call to DoModal() hangs

Posted on 1997-10-07
2
Medium Priority
?
442 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 400 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

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

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. …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses

765 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