4.7.1 Tracking Document Changes

Most server applications maintain a flag that records whether changes have been made to each open document of a particular instance. The following table shows the rules that apply to this flag when a server application edits an embedded object.

Flag Condition

TRUE DLL calls the Create function in OLESERVERVTBL.
TRUE DLL calls the CreateFromTemplate function in OLESERVERVTBL.
TRUE Document is changed in the server application.
FALSE DLL calls the Edit function in OLESERVERVTBL.
FALSE DLL calls the GetData function in OLEOBJECTVTBL with the Native data format. (The flag should not change for any other formats.)

By following these rules, a server application can ensure that this flag is TRUE when the document it is editing matches the embedded object in the client application and that, otherwise, this flag is FALSE.

A server application following these rules displays a message asking whether to update the object whenever it destroys a document that contains an embedded object and the dirty flag is TRUE.

The File menu commands are generally those that need to watch this flag in order to prompt the user to save changes.