|
IDataObject::GetCanonicalFormatEtc
Provides a potentially different but logically equivalent FORMATETC structure. You use this method when you have different FORMATETC structures that may return the same data.
HRESULT GetCanonicalFormatEtc(
FORMATETC * pFormatetcIn,
| //Points to the FORMATETC structure that the caller would like to use
| FORMATETC * pFormatetcOut
| //Points to the canonical equivalent FORMATETC structure
| );
|
|
Parameters
pFormatetcIn
[in]Points to the format, media, and target device that the caller would like
to use in a subsequent call to retrieve data, for example, IDataObject::GetData. The TYMED member is not significant and should be ignored.
pFormatetcOut
[out]Points to a FORMATETC structure that is canonically equivalent to pFormatetcIn. The caller allocates this structure and this method fills in the data. In a
subsequent call to retrieve data, for example, IDataObject::GetData, the caller uses the pFormatetcOut value. This value is NULL if the method returns DATA_S_SAMEFORMATETC. The
TYMED member is not significant and should be ignored.
Return Values
S_OK
The returned FORMATETC structure is different from the one that was passed.
E_INVALIDARG
One or more arguments are invalid.
E_UNEXPECTED
An unexpected error occurred.
E_OUTOFMEMORY
Structure was not created because the system ran out of memory.
DATA_S_SAMEFORMATETC
The FORMATETC structures are the same and NULL is returned in pFormatetcOut.
DV_E_LINDEX
Invalid value for lindex; currently, only -1 is supported.
DV_E_FORMATETC
Invalid value for pFormatetc.
OLE_E_NOTRUNNING
Object application is not running.
Comments
A data object can return exactly the same data even though you have specified
different FORMATETC structures in subsequent requests to retrieve data. For example, the same
data can be returned for different target devices if the data is not sensitive to
the target devices.
The IDataObject::GetCanonicalFormatEtc method provides the canonical equivalent of a specified FORMATETC structure. By calling this function prior to retrieving the data object, you
can use the canonical equivalent FORMATETC in your subsequent call to IDataObject::GetData. You can then eliminate unnecessary calls to retrieve data if two different FORMATETC structures have the same canonical equivalent.
If the data object never provides device-specific renderings, the
implementation of IDataObject::GetCanonicalFormatEtc simply copies the input FORMATETC to the output FORMATETC, stores a NULL in the ptd field of the output FORMATETC, and returns DATA_S_SAMEFORMATETC.
See Also
IDataObject::GetData, FORMATETC
Related LinksSoftware for Delphi and C++ Builder developers Software for Visual Studio .NET developers Software for Visual Basic 6 developers Delphi Tips&Tricks
MegaDetailed.NET
TMS Scripter Studio Pro components for Delphi/C++Builder
More Online Helps Win32 Programmer's Reference (win32.hlp) Win32 Multimedia Programmer's Reference (mmedia.hlp) Microsoft Windows Pen API Programmer's Reference (penapi.hlp) Microsoft Windows Sockets 2 Reference (sock2.hlp) Microsoft Windows Telephony API (TAPI) Programmer's Reference (sock2.hlp) Unix Manual Pages
|