Solved

Second call to DoModal() hangs

Posted on 1997-10-07
2
430 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
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

Title # Comments Views Activity
move a line in eclipse 3 109
Doc'in system (example?) BA 7 120
post4 challenge 28 113
My project did see openJDK that I installed. What could be the problem 7 161
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

733 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