OleObjectConvert

  OLESTATUS OleObjectConvert(lpObject, lpszProtocol, lpClient, lhClientDoc, lpszObjname, lplpObject)    
  LPOLEOBJECT lpObject; /* pointer to object to convert */
  LPCSTR lpszProtocol; /* pointer to string for protocol name */
  LPOLECLIENT lpClient; /* pointer to client for new object */
  LHCLIENTDOC lhClientDoc; /* long handle to client document */
  LPCSTR lpszObjname; /* string for object name */
  LPOLEOBJECT FAR* lplpObject; /* pointer to pointer to new object */

The OleObjectConvert function creates a new object that supports a specified protocol by converting an existing object. This function neither deletes nor replaces the original object.

Parameters

lpObject

Points to the object to convert.

lpszProtocol

Points to a null-terminated string specifying the name of the required protocol. Currently this value can be “Static,” for uneditable pictures only. Attempts to open static objects fail and generate no notifications.

lpClient

Points to an OLECLIENT structure for the new object.

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.

lplpObject

Points to a variable in which the library stores a pointer to the new object.

Return Value

The return value is OLE_OK if the function is successful. Otherwise, it is an error value, which can be one of the following:

OLE_BUSY
OLE_ERROR_HANDLE
OLE_ERROR_NAME
OLE_ERROR_OBJECT
OLE_ERROR_STATIC

Comments

The only conversion currently supported is converting linked or embedded objects to static objects.

See Also

OleCreateFromTemplate