Solved

Override the Save

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

705 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