Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This method retrieves a data object that contains the current contents of the embedded object on which this method is called. Using the pointer to this data object, it is possible to create an embedded object with the same data as the original.

Syntax

HRESULT GetClipboardData( 
  DWORD 
dwReserved, 
  IDataObject** 
ppDataObject
);

Parameters

dwReserved

[in] Reserved for future use; set to zero.

ppDataObject

[out] Address of IDataObject* pointer variable that receives the interface pointer to the data object. If an error occurs, * ppDataObjectmust be set to NULL.

Each time an object receives a call to GetClipboardData, it must increase the reference count on * ppDataObject.

The caller is responsible to call IUnknown::Releasewhen it is done with * ppDataObject.

Return Value

One of the values in the following table is returned.

Value Description

S_OK

The data transfer object is returned.

E_NOTIMPL

GetClipboardDatais not supported.

OLE_E_NOTRUNNING

The object is not running.

Remarks

You can use the GetClipboardDatamethod to convert a linked object to an embedded object, in which case the container application would call GetClipboardDataand then pass the data received to OleCreateFromData.

This method returns a pointer to a data object that is identical to what would have been passed to the Clipboard by a standard copy operation.

To determine whether the platform supports this interface, see Determining Supported COM APIs.

Notes to Callers

If you want a stable snapshot of the current contents of an embedded object, call GetClipboardData.

If the data changes, you must call the function again for an updated snapshot.

If you want the caller to be informed of changes that occur to the data, call IUnknown::QueryInterfaceand then call IDataObject::DAdvise.

Notes to Implementers

If you implement this function, you must return an IDataObjectpointer for an object whose data will not change.

Requirements

Header Oleidl.h, oleidl.idl
Library oleaut32.lib, uuid.lib
Windows Embedded CE Windows CE 2.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also