Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

IDataObject.GetCanonicalFormatEtc Method

Provides a standard FORMATETC structure that is logically equivalent to a more complex structure. Use this method to determine whether two different FORMATETC structures would return the same data, removing the need for duplicate rendering.

Namespace:  System.Runtime.InteropServices.ComTypes
Assembly:  System (in System.dll)

int GetCanonicalFormatEtc(
	ref FORMATETC formatIn,
	out FORMATETC formatOut
)

Parameters

formatIn
Type: System.Runtime.InteropServices.ComTypes.FORMATETC%
A pointer to a FORMATETC structure, passed by reference, that defines the format, medium, and target device that the caller would like to use to retrieve data in a subsequent call such as GetData. The TYMED member is not significant in this case and should be ignored.
formatOut
Type: System.Runtime.InteropServices.ComTypes.FORMATETC%
When this method returns, contains a pointer to a FORMATETC structure that contains the most general information possible for a specific rendering, making it canonically equivalent to formatetIn. The caller must allocate this structure and the GetCanonicalFormatEtc method must fill in the data. To retrieve data in a subsequent call such as GetData, the caller uses the supplied value of formatOut, unless the value supplied is null. This value is null if the method returns DATA_S_SAMEFORMATETC. The TYMED member is not significant in this case and should be ignored. This parameter is passed uninitialized.

Return Value

Type: System.Int32
This method supports the standard return values E_INVALIDARG, E_UNEXPECTED, and E_OUTOFMEMORY, as well as the following:

Value

Description

S_OK

The returned FORMATETC structure is different from the one that was passed.

DATA_S_SAMEFORMATETC

The FORMATETC structures are the same and null is returned in the formatOut parameter.

DV_E_LINDEX

There is an invalid value for lindex; currently, only -1 is supported.

DV_E_FORMATETC

There is an invalid value for the pFormatetc parameter.

OLE_E_NOTRUNNING

The application is not running.

For more information about IDataObject::GetCanonicalFormatEtc, see the MSDN Library.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Community Additions

ADD
Show:
© 2015 Microsoft