OleQueryCreateFromClip

3.1

  #include <ole.h>    

  OLESTATUS OleQueryCreateFromClip(lpszProtocol, renderopt, cfFormat)    
  LPCSTR lpszProtocol; /* address of string for protocol name */
  OLEOPT_RENDER renderopt; /* rendering options */
  OLECLIPFORMAT cfFormat; /* format for clipboard data */

The OleQueryCreateFromClip function checks whether the object on the clipboard supports the specified protocol and rendering options.

Parameters

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).

renderopt

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

Value Meaning

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

cfFormat

Specifies the clipboard format. This parameter is used only when the renderopt parameter is olerender_format. If the 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.

Return Value

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

OLE_ERROR_FORMAT OLE_ERROR_PROTOCOL

Comments

The OleQueryCreateFromClip function is typically used to check whether to enable a Paste command.

The olerender_none rendering option is typically used to support hyperlinks. With this option, the client does not call OleDraw and calls the OleGetData function only for ObjectLink, OwnerLink, and Native formats.

The olerender_format rendering option allows a client to compute data (instead of painting it), use an unusual data format, or modify a standard data format. With this option the client does not call OleDraw. The client calls OleGetData to retrieve data in the specified format.

The olerender_draw rendering option is the most typical option. It is the easiest rendering option for the client to implement (the client simply calls OleDraw), and it allows the most flexibility. An object handler can exploit this flexibility to store no presentation data, a private presentation data format, or several different formats that it can choose among dynamically. Future implementations of object linking and embedding (OLE) may also exploit the flexibility that is inherent in this option.

See Also

OleCreateFromClip, OleDraw, OleGetData