?
Solved

How to avoid from getting a save message when closing a document?

Posted on 2002-05-27
3
Medium Priority
?
217 Views
Last Modified: 2013-11-20
Hi,

I'm doing an MDI application in which my windows, which are a CRichEditView windows, view files.
When I close each window I get this messagebox which asks me if I want to save the file.
I do not want this message to pop up, and I found that it appears in the CFrameWnd::OnClose function.
What can I do to bypass this message?
0
Comment
Question by:shmuelal
3 Comments
 
LVL 32

Expert Comment

by:jhance
ID: 7036894
I'm sure there are 100 ways but one would be to override the CFrameWnd:OnClose function and avoid displaying the confirmation dialog.
0
 
LVL 31

Accepted Solution

by:
Zoppo earned 400 total points
ID: 7036895
Hi shmuelal,

override for your CDocument-derived class the function:
virtual BOOL SaveModified( );

and in there return TRUE if the document should be closed.

hope that helps,

ZOPPO
0
 

Author Comment

by:shmuelal
ID: 7036903
Thanks - It works!
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

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…
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. …
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.
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

831 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