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. |
This interface is used to enumerate an array of FORMATETCstructures. IEnumFORMATETChas the same methods as all enumerator interfaces: Next, Skip, Reset, and Clone.
When to Implement
IEnumFORMATETCmust be implemented by all data objects to support calls to the IDataObject::EnumFormatEtcmethod, which supplies a pointer to the enumerator's IEnumFORMATETCinterface. If the data object supports a different set of FORMATETCinformation depending on the direction of the data (whether a call is intended for the SetDataor GetDatamethod of IDataObject), the implementation of IEnumFORMATETCmust be able to operate on both.
The order of formats enumerated through the IEnumFORMATETCobject should be the same as the order that the formats would be in when placed on the Clipboard. Typically, this order starts with private data formats and ends with presentation formats, such as CF_METAFILEPICT.
When to Use
Call the methods of IEnumFORMATETCwhen you need to enumerate the FORMATETCstructures defining the formats and media supported by a given data object.
This is necessary in most data transfer operations, such as Clipboard and drag-and-drop, so the object on the other end of the data transfer can determine whether the appropriate format and media for the data is supported.
Note To Implementers
If the IEnumFORMATETC::Nextmethod returns a non-NULL DVTARGETDEVICE pointer in the ptdmember of the FORMATETCstructure, it must be allocated with the CoTaskMemAllocfunction (or its equivalent).
Note to Callers
If the IEnumFORMATETC::Nextmethod returns a non-NULL DVTARGETDEVICE pointer in the ptdmember of the FORMATETCstructure, the memory must be freed with the CoTaskMemFreefunction (or its equivalent).
Failure to do so will result in a memory leak.
Methods
The following table shows the methods for this interface in alphabetical order.
IEnumFORMATETC method | Description |
---|---|
Creates another enumerator that contains the same enumeration state as the current enumerator. |
|
Retrieves the next celtitems in the enumeration sequence. |
|
Resets the enumeration sequence to the beginning. |
|
Skips over the next specified number of elements in the enumeration sequence. |
Remarks
To determine whether the platform supports this interface, see Determining Supported COM APIs.
Requirements
Header | objidl.h, objidl.idl |
Library | ole32.lib, uuid.lib |
Windows Embedded CE | Windows CE 3.0 and later |
Windows Mobile | Windows Mobile Version 5.0 and later |