Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Collapse the table of content
Expand the table of content


Call this function to create an embedded item from a COleDataObject object.

BOOL CreateFromData( 
   COleDataObject* pDataObject, 
   CLIPFORMAT cfFormat = 0, 
   LPFORMATETC lpFormatEtc = NULL  


Pointer to the COleDataObject object from which the OLE item is to be created.


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


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


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.

Nonzero if successful; otherwise 0.

Data transfer operations, such as pasting from the Clipboard or drag-and-drop operations, provide COleDataObject objects containing the information offered by a server application. It is usually used in your override of CView::OnDrop.

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

Header: afxole.h

Community Additions

© 2015 Microsoft