Solved

Preventing an MDI child from closing

Posted on 1997-08-12
3
304 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
Comment Utility
If OnDestroy() is too late, what about OnClose()?
It gets called before OnDestroy().

Davide Marcato.
0
 

Author Comment

by:skin
Comment Utility
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
Comment Utility
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Host to IP 7 73
zeroMAx challenge 20 76
Line meaning 9 75
sumHeights  challenge 17 59
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

762 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now