Share via


IEnumSTATDATA (Compact 2013)

3/26/2014

This interface is used to enumerate through an array of STATDATA structures, which contain advisory connection information for a data object.

IEnumSTATDATA has the same methods as all enumerator interfaces: Next, Skip, Reset, and Clone.

For general information on these methods, see IEnumXXXX.

When to Implement

IEnumSTATDATA is implemented to enumerate advisory connections. Most applications will not implement this directly, but will use the OLE-provided implementation. Pointers to this implementation are available in two ways:

  • In a data object, call the CreateDataAdviseHolder function to get a pointer to the OLE data advise holder object, and then, to implement the IDataObject::EnumDAdvise method, call IDataAdviseHolder::EnumAdvise, which creates the enumeration object and supplies a pointer to the implementation of IEnumSTATDATA.
  • In a compound document object, call the CreateOleAdviseHolder function to get a pointer to the OLE advise holder object, and then, to implement IOleObject::EnumAdvise, call IOleAdviseHolder::EnumAdvise, which creates the enumeration object and supplies a pointer to the implementation of IEnumSTATDATA.

When to Use

Containers usually call methods that return a pointer to IEnumSTATDATA so the container can use its methods to enumerate the existing advisory connections, and use this information to instruct an object to release each of its advisory connections prior to closing down. The IDataObject::EnumDAdvise and IOleAdviseHolder::EnumAdvise methods both supply a pointer to IEnumSTATDATA.

The prototypes of the methods are as follows.

HRESULT Next(
  ULONG celt,           
  STATDATA * rgelt,     
  ULONG * pceltFetched  
);
 
HRESULT Skip(
  ULONG celt  
);
 
HRESULT Reset(void)
 
HRESULT Clone(
  IEnumSTATDATA ** ppenum  
);

Methods

The following table shows the methods for this interface in alphabetical order.

Method

Description

Clone

Creates a copy of the current state of enumeration.

Next

Retrieves a specified number of items in the enumeration sequence.

Reset

Resets the enumeration sequence to the beginning.

Skip

Skips over a specified number of items 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

See Also

Reference

COM Interfaces
IEnumSTATDATA::Clone
IEnumSTATDATA::Reset
IEnumSTATDATA::Skip
IOleAdviseHolder::EnumAdvise