Home COM GDI+ WebBrowser Data Access

IEnumFORMATETC Interface

 

IID_IEnumFORMATETC

{00000103-0000-0000-C000-000000000046}

 

 

The IEnumFORMATETC interface is used to enumerate an array of FORMATETC structures. IEnumFORMATETC has the same methods as all enumerator interfaces: Next, Skip, Reset, and Clone.

 

Call the methods of IEnumFORMATETC when you need to enumerate the FORMATETC structures 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: If the IEnumFORMATETC::Next method returns a non-NULL DVTARGETDEVICE pointer in the ptd member of the FORMATETC structure, the memory must be freed with the CoTaskMemFree function (or its equivalent). Failure to do so will result in a memory leak.

 

 

Methods in VTable order

IUnknown Methods

Description

QueryInterface

Returns pointers to supported interfaces.

AddRef

Increments reference count.

Release

Decrements reference count.

IEnumFORMATETC Methods

Description

Next

Retrieves a specified number of items in the enumeration sequence.

Skip

Skips over a specified number of items in the enumeration sequence.

Reset

Resets the enumeration sequence to the beginning.

Clone

Creates another enumerator that contains the same enumeration state as the current one.

 

Next

 

FUNCTION IEnumFORMATETC_Next ( _

  BYVAL pthis AS DWORD PTR _

, BYVAL celt AS DWORD _

, BYVAL rgelt AS DWORD _

, BYVAL pceltFetched AS DWORD _

  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[3] USING IEnumFORMATETC_Next (pthis, celt, rgelt, pceltFetched) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

Skip

 

FUNCTION IEnumFORMATETC_Skip ( _

  BYVAL pthis AS DWORD PTR _

, BYVAL celt AS DWORD _

  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[4] USING IEnumFORMATETC_Skip (pthis, celt) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

Reset

 

FUNCTION IEnumFORMATETC_Reset ( _

  BYVAL pthis AS DWORD PTR _

  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[5] USING IEnumFORMATETC_Reset (pthis) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

Clone

 

FUNCTION IEnumFORMATETC_Clone ( _

  BYVAL pthis AS DWORD PTR _

, BYREF ppenum AS DWORD _

  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[6] USING IEnumFORMATETC_Clone (pthis, ppenum) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

Page last updated on Monday, 03 April 2006 20:29:04 +0200