Solved

Preventing an MDI child from closing

Posted on 1997-08-12
3
353 Views
Last Modified: 2013-11-19
I have an MDI application in which I want to get notified when a child is closing and then check to see if modifications were made.  If so, I want to put up a "Save? Yes, No, or Cancel" dialog and if they select cancel, prevent the child from closing.  OnDestroy in my view class is too late.  Any ideas?
0
Comment
Question by:skin
  • 2
3 Comments
 
LVL 4

Expert Comment

by:davmarc
ID: 1303591
If OnDestroy() is too late, what about OnClose()?
It gets called before OnDestroy().

Davide Marcato.
0
 

Author Comment

by:skin
ID: 1303592
I'm not sure why OnClose or WM_CLOSE are not one of the messages available in ClassWizard for my view class.  If I put in in by hand it does not appear to get called before (or after) OnDestroy.  I would have though it would have too.
Steve
0
 
LVL 4

Accepted Solution

by:
davmarc earned 100 total points
ID: 1303593
Sorry for not specifying - I meant you should try to override the OnClose() member of your frame window. It gets the WM_CLOSE message in place of the view.

Davide Marcato.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

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…
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.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

756 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