7.1.11 The OLEOBJECTVTBL Structure

The OLEOBJECTVTBL structure points to the callback functions that manipulate an object. After a server application creates this structure and an OLEOBJECT structure (which points to OLEOBJECTVTBL), the OLESVR.DLL can access an object.

The OLEOBJECTVTBL structure is defined in OLE.H as follows:

typedef struct _OLEOBJECTVTBL {

LPVOID (CALLBACK *QueryProtocol)(LPOLEOBJECT, OLE_LPCSTR);

OLESTATUS (CALLBACK *Release)(LPOLEOBJECT);

OLESTATUS (CALLBACK *Show)(LPOLEOBJECT, BOOL);

OLESTATUS (CALLBACK *DoVerb)(LPOLEOBJECT, UINT, BOOL, BOOL);

OLESTATUS (CALLBACK *GetData)(LPOLEOBJECT, OLECLIPFORMAT,

HANDLE FAR*);

OLESTATUS (CALLBACK *SetData)(LPOLEOBJECT, OLECLIPFORMAT,

HANDLE);

OLESTATUS (CALLBACK *SetTargetDevice)(LPOLEOBJECT, HGLOBAL);

OLESTATUS (CALLBACK *SetBounds)(LPOLEOBJECT, OLE_CONST RECT FAR*);

OLECLIPFORMAT (CALLBACK *EnumFormats)(LPOLEOBJECT, OLECLIPFORMAT);

OLESTATUS (CALLBACK *SetColorScheme)(LPOLEOBJECT, OLE_CONST

LOGPALETTE FAR*);

} OLEOBJECTVTBL

7.1.11.1 OLEOBJECTVTBL Structure Summary

The following table lists the members of the OLEOBJECTVTBL data structure. Each member points to a specific callback function.

Structure Member Description

QueryProtocol Determines which protocols the server applications supports.
Release Frees the resources associated with the specified OLEOBJECT structure.
Show Shows an object's window by making it visible.
DoVerb Specifies what kind of action a server should take when an object is opened.
GetData Returns a handle to the requested data.
SetData Provides the server with the object's native data.
SetTargetDevice Gives information about the client's target device for the object.
SetBounds Returns OLE_OK. Provided for compatibility only.
EnumFormats Enumerates the data formats that the object can render.
SetColorScheme Specifies the palette to be used when the server application edits an object.