Solved

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

Posted on 2002-05-27
3
214 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
[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
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 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

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

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.
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.
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…

691 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