Solved

Override the Save

Posted on 1998-06-24
2
312 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
[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
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying 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

Suggested Solutions

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.

730 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