?
Solved

Second call to DoModal() hangs

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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

649 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