A server application can call the OleSavedServerDoc function whenever an object needs to be updated in the client application's document, including when the server application closes the document. If the server application closes the document and the object should be updated, it should send an OLE_CLOSED notification to the client application's CallBack function. Client applications receive the OLE_CLOSED notification for embedded objects but not for linked objects.
File New (for an SDI server application) and File Close/Exit may require the server application to notify the client application if the client application doesn't accept updates of changes through OleSavedServerDoc. Calls like OleSavedServerDoc generally handle these client notifications automatically. The cases where the server application must directly send a notification code to CallBack are:
Notification Code | Condition |
OLE_CHANGED | Any operation that changes the object, making it "dirty." Not necessary for embedded objects. |
OLE_CLOSED | When the user closes a document with embedded objects that require updating (that is, changed objects), before calling OleRevokeServerDoc. |
The OLE_CHANGED notification allows the client application to dynamically update the object as the user changes it in the server application.