OleCreateInvisible

  OLESTATUS OleCreateInvisible(lpszProtocol, lpClient, lpszClass, lhClientDoc, lpszObjname, lplpObject, renderopt, cfFormat, fActivate)    
  LPCSTR lpszProtocol; /* pointer to string for protocol name */
  LPOLECLIENT lpClient; /* pointer to client structure */
  LPCSTR lpszClass; /* pointer to string for classname */
  LHCLIENTDOC lhClientDoc; /* long handle to client document */
  LPCSTR lpszObjname; /* pointer to string for object name */
  LPOLEOBJECT FAR *lplpObject; /* pointer to pointer to object */
  OLEOPT_RENDER renderopt; /* rendering options */
  OLECLIPFORMAT cfFormat; /* clipboard format */
  BOOL fActivate; /* server activation flag */

The OleCreateInvisible function creates an object without displaying the server application to the user. The function either starts the server to create the object or creates a blank object of the specified class and format without starting the server.

Parameters

lpszProtocol

Points to a null-terminated string specifying the name of the protocol required for the new embedded object. Currently this value can be “StdFileEditing” (the name of the OLE protocol) or “Static” (for uneditable pictures only).

lpClient

Points to an OLECLIENT structure allocated and initialized by the client application. This pointer is used to locate the callback function and is passed in callback notifications.

lpszClass

Points to a null-terminated string specifying the registered name of the class of the object to be created.

lhClientDoc

Identifies the client document in which the object is being created.

lpszObjname

Points to a null-terminated string specifying the client's name for the object. This name must be unique with respect to the names of any other objects in the document and cannot contain the forward-slash (“/”) character.

lplpObject

Points to a variable where the DLL will store the long pointer to the new object.

renderopt

Specifies the client's preference for presentation data for the object. This parameter can be one of the following values:

Value Meaning

olerender_none  
  The client DLL does not obtain any presentation data and does not draw the object.
olerender_draw  
  The client calls the OleDraw function, and the DLL obtains and manages presentation data.
olerender_format  
  The client calls the OleGetData function to retrieve data in a specific format. The DLL obtains and manages the data in the requested format, as specified by the cfFormat parameter.

cfFormat

Specifies the clipboard format when the renderopt parameter is olerender_format. This clipboard format is used in a subsequent call to the OleGetData function. If this clipboard format is CF_METAFILEPICT, CF_DIB, or CF_BITMAP, the DLL manages the data and draws the object. The DLL does not support drawing for any other formats.

fActivate

Specifies whether to start the server for the object. If this parameter is TRUE the server is started (but not shown). If this parameter is FALSE, the server is not started and the function creates a blank object of the specified ass and format.

Return Value

If the function is successful, the return value is OLE_OK; otherwise, it is an error value, which may be one of the following:

OLE_ERROR_HANDLE
OLE_ERROR_NAME
OLE_ERROR_PROTOCOL

Comments

An application can avoid redrawing an object repeatedly by calling the OleCreateInvisible function before using such functions as OleSetBounds, OleSetColorScheme and OleSetTargetDevice to set up the object. After setting up the object, the application can either call the OleActivate function to display the object, or the OleUpdate and OleClose functions to update the object without displaying it.

See Also

OleActivate, OleClose, OleSetBounds, OleSetColorScheme, OleSetTargetDevice, OleUpdate