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
Solved

Preventing an MDI child from closing

Posted on 1997-08-12
3
340 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how to monitor remote shell execution on linux 9 104
Detect file exist or not 3 180
Thin secure Windows 10 5 102
Problem to open Excel file 15 178
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

829 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