Overriding the Save function
-
Hi all, again, this is just a quick question. I have managed to create my own OnOpen and OnNew functions in my project in the CMainFrame class, however, I`ve tried doing it exactly the same for OnSave (not OnSaveAs - yet, cos I can`t get this going) but the function never gets executed - despite me clicking the menu button Save (I get the crappy dialog box coming up with Save As on it for some reason???). Just wondered if anyone had experienced similar problems, and what the solution was. I`ve tried overriding in both CMainFrame and CMDIFrame class but neither works, Cheers guys, Alan. "When I left you I was but the learner, now I am the Master" - Darth Vader:mad:
-
Hi all, again, this is just a quick question. I have managed to create my own OnOpen and OnNew functions in my project in the CMainFrame class, however, I`ve tried doing it exactly the same for OnSave (not OnSaveAs - yet, cos I can`t get this going) but the function never gets executed - despite me clicking the menu button Save (I get the crappy dialog box coming up with Save As on it for some reason???). Just wondered if anyone had experienced similar problems, and what the solution was. I`ve tried overriding in both CMainFrame and CMDIFrame class but neither works, Cheers guys, Alan. "When I left you I was but the learner, now I am the Master" - Darth Vader:mad:
Hi U can override SaveModified which is the function which gets called when the 'Save' or 'Save As' Happens, This is the function that prompts the Saving and then calls DoFileSave-->DoSave. So if u want to tailor to ur own needs i would recommend that u copy the original code and modify to tailor ur needs, U can find the source in 'doccore.cpp'(mfc src). regards, Prem