Saving before close
-
Hi guys I'd like to ask the user to save his Doc before exit in my SDI app and then do like he pressed the Save button in menu. Where I have to do the call, and how? Best Regards Doc
With a "normal" SDI app, everything is already in place. If the document's data is serializable, put your code in the
Serialize()
method. Otherwise, put your code in theOnSaveDocument()
method.
Five birds are sitting on a fence. Three of them decide to fly off. How many are left?
-
Hi guys I'd like to ask the user to save his Doc before exit in my SDI app and then do like he pressed the Save button in menu. Where I have to do the call, and how? Best Regards Doc
You need to monitor when the user has made a change in the document which you count as significant enough to require saving. For example the user updated a text box on your form, or drew a circle, or whatever. When that happens you must call the SetModifiedFlag(TRUE) method of your document class. The framework will then automatically prompt the user to save the document if they close the window. Of course you still need to add code in OnSaveDocument or Serialize to actually do the work of saving to a file just as the previous user indicated. Hope it helps... -- The Obliterator
-
Hi guys I'd like to ask the user to save his Doc before exit in my SDI app and then do like he pressed the Save button in menu. Where I have to do the call, and how? Best Regards Doc