Re: Closing modeless dialogs
- From: David Wilkinson <no-reply@xxxxxxxxxxxx>
- Date: Wed, 12 Mar 2008 07:12:41 -0400
Torsten Hensel wrote:
Joseph M. Newcomer wrote:
Modeless dialogs are one of the places where you typically have to
actually allocate on the heap.
What's the reason for this? I need to display a dialog, do something while the dialog is displayed, then close the dialog and dismiss the object. I don't see a problem here with allocating the object on the stack.
Creating one during InitInstance is a bit dangerous, because the
message pump is not yet working.
I think I understand this problem. But how can I achieve what I want without creating the dialog in InitInstance? Ok, some more explanations:
I created a dialog based application in VisualStudio just to get the simplest possible MFC application. I only want to display a dialog (simply showing something like "Please wait"), then call two functions, finally close the dialog and end the application. So the dialog does not need to exist after InitInstance is done.
Torsten:
Maybe I'm missing something, but if you have an MFC dialog application why don't you just use the default modal dialog? Why does your dialog need to be modeless?
--
David Wilkinson
Visual C++ MVP
.
- Follow-Ups:
- Re: Closing modeless dialogs
- From: Torsten Hensel
- Re: Closing modeless dialogs
- References:
- Closing modeless dialogs
- From: Torsten Hensel
- Re: Closing modeless dialogs
- From: Joseph M . Newcomer
- Re: Closing modeless dialogs
- From: Torsten Hensel
- Closing modeless dialogs
- Prev by Date: Re: MFC/C++ vs .Net/C#
- Next by Date: Directory watcher
- Previous by thread: Re: Closing modeless dialogs
- Next by thread: Re: Closing modeless dialogs
- Index(es):
Relevant Pages
|