Solved

Override the Save

Posted on 1998-06-24
2
303 Views
Last Modified: 2013-11-20
Using MFC,  I am trying to override the OnSave Function.  Yet, If I click Save As it still goes to the System Controlled Dialog Box, before going to my function.   This also happens if I save for the first time. How do I get around this?  There doesn't seem to be an OnSaveAs Function to override, at least not in ClassWizard.  

Thanks!!  
0
Comment
Question by:smithc
2 Comments
 
LVL 7

Accepted Solution

by:
galkin earned 50 total points
ID: 1318374
You user chooses File Save command WM_COMMAND message with ID_FILE_SAVE is sent to main application window and is handled by cDocument class OnFileSave function. you can override this behaviour by declaring your own message handler in your document class.
Add to your document class message map
ON_COMMAND(ID_FILE_SAVE, OnFileSave)
add afx_msg void OnFileSave() to your document class declaration
and add OnFileSave() function implementation
0
 

Author Comment

by:smithc
ID: 1318375
Perfect.   I wonder why I couldn't find the option to override OnFileSave in ClassWizard??

Thanks
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

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…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

762 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

21 Experts available now in Live!

Get 1:1 Help Now