OLESTATUS OleQueryCreateFromClip(lpszProtocol, renderopt, cfFormat) | |||||
LPCSTR lpszProtocol; | /* pointer to string for protocol name | */ | |||
OLEOPT_RENDER renderopt; | /* rendering options | */ | |||
OLECLIPFORMAT cfFormat; | /* format for clipboard data | */ |
The OleQueryCreateFromClip function determines whether the object on the clipboard supports the specified protocol and rendering options.
lpszProtocol
Points to a null-terminated string specifying the name of the protocol needed by the client. Currently this value can be “StdFileEditing”, the name of the object linking and embedding protocol, or “Static”, for uneditable pictures only. Attempts to open static objects fail and generate no notifications.
renderopt
Specifies the client's preference for displaying and printing the object. This parameter can be one of the following values:
Value | Meaning |
olerender_none | ||
The object is not shown or an object handler does the rendering. The client library does not obtain any presentation data and does not draw the object. | ||
olerender_draw | ||
The client calls the OleDraw function and the library obtains and manages presentation data. | ||
olerender_format | ||
The client calls the OleGetData function to retrieve data in a specific format. The library obtains and manages the data in the requested format, as specified by the cfFormat parameter. |
cfFormat
Specifies the clipboard format the client requests when it calls the OleGetData function. This parameter is used only when the renderopt parameter is olerender_format. If this clipboard format is CF_METAFILEPICT, CF_DIB, or CF_BITMAP, the library manages the data and draws the object. The library does not support drawing for any other formats.
The return value is OLE_OK if the function is successful. Otherwise, it is an error value, which can be OLE_ERROR_FORMAT or OLE_ERROR_PROTOCOL.
The OleQueryCreateFromClip function is typically used to determine whether to enable a Paste command.
OleCreateFromClip, OleDraw, OleGetData