Solved

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

Posted on 2002-05-27
3
208 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 30

Accepted Solution

by:
Zoppo earned 100 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

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. …
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.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

757 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

23 Experts available now in Live!

Get 1:1 Help Now