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

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?
shmuelalAsked:
Who is Participating?
 
ZoppoConnect With a Mentor Commented:
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
 
jhanceCommented:
I'm sure there are 100 ways but one would be to override the CFrameWnd:OnClose function and avoid displaying the confirmation dialog.
0
 
shmuelalAuthor Commented:
Thanks - It works!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.