Freigeben über


COleClientItem::CreateLinkFromClipboard

Call this function to create a linked item from the contents of the Clipboard.

BOOL CreateLinkFromClipboard( 
   OLERENDER render = OLERENDER_DRAW, 
   CLIPFORMAT cfFormat = 0, 
   LPFORMATETC lpFormatEtc = NULL  
);

Parameters

  • render
    Flag specifying how the server will render the OLE item. For the possible values, see OLERENDER in the Windows SDK.

  • cfFormat
    Specifies the Clipboard data format to be cached when creating the OLE item.

  • lpFormatEtc
    Pointer to a FORMATETC structure used if render is OLERENDER_FORMAT or OLERENDER_DRAW. Provide a value for this parameter only if you want to specify additional format information beyond the Clipboard format specified by cfFormat. If you omit this parameter, default values are used for the other fields in the FORMATETC structure.

Return Value

Nonzero if successful; otherwise 0.

Remarks

You typically call this function from the message handler for the Paste Link command on the Edit menu. (The Paste Link command is enabled in the default implementation of COleDocument if the Clipboard contains an OLE item that can be linked to.)

For more information, see OLERENDER and FORMATETC in the Windows SDK.

Requirements

Header: afxole.h

See Also

Reference

COleClientItem Class

Hierarchy Chart

COleClientItem::CanPasteLink

COleClientItem::CreateLinkFromData

COleDataObject::AttachClipboard