Re: Closing modeless dialogs



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
.



Relevant Pages

  • Re: Inheritance and MFC
    ... But it cannot interact with the mouse or display unless ... So CObject buys nothing. ... I didn't see a need to inherit from CWnd, since all I needed was Serialization. ... BUt either you are using MFC, in which case adding CWnd doesn't matter, or it does not use ...
    (microsoft.public.vc.mfc)
  • Re: Vista, MFC and Maximizing Child Windows
    ... Are you sure this isn't just your display? ... it fills the screen edge to edge. ... Note that it is unlikely that this has anything at all to do with MFC, since window ...
    (microsoft.public.vc.mfc)
  • Re: Question regarding SetROP2 and font text output.
    ... I figured that the MFC was pretty much just a bunch of object oriented ... wrappers to Win32, but good to get confirmation on that. ... I like to display it - and having the option to hide it as well. ... That should give you a better looking xor. ...
    (microsoft.public.win32.programmer.gdi)
  • Re: CEdit Control
    ... I would like to display the value of an int variable in a textbox. ... using the MFC Dialog based application compiled using visual studio.net 2005. ... Can anyone show me how can i display an int value in a CEdit textbox control? ...
    (microsoft.public.vc.mfc)
  • Re: drawing multiple imagefiles on screen
    ... > with mfc you can bitblt an image many times to the screen in different ... > picturebox. ... but i dont know how to display them on the screen. ... > FallenBlock * temp; ...
    (microsoft.public.dotnet.framework.drawing)