7.1.8 The OLESERVERDOCVTBL Structure

The OLESERVERDOCVTBL structure points to functions that manipulate a document. After a server application creates this structure and a corresponding OLESERVERDOC structure (which points to OLESERVERDOCVTBL), the OLESVR.DLL can access a document. The OLESERVERDOCVTBL structure is defined in OLE.H as follows:

typedef struct _OLESERVERDOCVTBL

{

OLESTATUS (CALLBACK* Save) (LPOLESERVERDOC);

OLESTATUS (CALLBACK* Close) (LPOLESERVERDOC);

OLESTATUS (CALLBACK* SetHostNames)(LPOLESERVERDOC, OLE_LPCSTR,

OLE_LPCSTR);

OLESTATUS (CALLBACK* SetDocDimensions)(LPOLESERVERDOC, OLE_CONST

RECT FAR*);

OLESTATUS (CALLBACK* GetObject) (LPOLESERVERDOC, OLE_LPCSTR,

LPOLEOBJECT FAR*, LPOLECLIENT);

OLESTATUS (CALLBACK* Release) (LPOLESERVERDOC);

OLESTATUS (CALLBACK* SetColorScheme)(LPOLESERVERDOC, OLE_CONST

LOGPALETTE FAR*);

OLESTATUS (CALLBACK* Execute) (LPOLESERVERDOC, HGLOBAL);

} OLESERVERDOCVTBL;

Documents opened or created on request from the server DLL should not be shown to the user for editing until the DLL requests that they be shown.

Every function except Release can return OLE_BUSY.

7.1.8.1 Summary of OLESERVERDOCVTBL Structure Members

The OLESERVERDOCVTBL data structure contains the following members, with each member pointing to an application-specific callback function:

Structure Member Description

Save Instructs the server to save the document.
Close Instructs the server application to unconditionally close the document.
SetHostNames Sets the names that should be used for window titles.
SetDocDimensions Gives the server the rectangle on the target device for which the object should be formatted.
GetObject Requests the server to create an OLEOBJECT structure and associate with an object.
Release Notifies the server when a revoked document has terminated conversations and object resources can be freed.
SetColorScheme Specifies the color palette preferred by the client application.
Execute Specifies DDE execute strings.