Solved

Preventing an MDI child from closing

Posted on 1997-08-12
3
356 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
[X]
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
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
unable to delete all specified values regedit 38 862
pre4 challenge 19 114
noX challenge 17 142
wordcount challenge 11 163
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

740 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