OleClone

  OLESTATUS OleClone(lpObject, lpClient, lhClientDoc, lpszObjname, lplpObject)    
  LPOLEOBJECT lpObject; /* pointer to object to copy */
  LPOLECLIENT lpClient; /* pointer to OLECLIENT 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 OleClone function makes a copy of an object. The copy is identical to the source object, but it is not connected to the server.

Parameters

lpObject

Points to the object to copy.

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 where the library will store the long 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_OBJECT
OLE_WAIT_FOR_RELEASE

Comments

Client applications often use the OleClone function to support the Undo command.

Client applications can supply a new OLECLIENT structure for the cloned object, if required.

See Also

OleEqual