This interface is used to enumerate through an array of STATSTG structures that contains statistical information about an open storage, stream, or byte array object. This interface has the same methods as all enumerator interfaces: Next, Skip, Reset, and Clone.
At a Glance
Header file: | Objidl.h |
Windows CE versions: | 2.0 and later |
The IEnumSTATSTG interface is used to enumerate through an array of STATSTG structures, which contain statistical information about an open storage, stream, or byte array object. IEnumSTATSTG has the same methods as all enumerator interfaces: Next, Skip, Reset, and Clone.
When to Implement
IEnumSTATSTG is implemented to enumerate the elements of a storage object. If you are using the compound file implementation of the storage object, a pointer to which is available through a call to StgCreateDocfile, IEnumSTATSTG is implemented on that object, and a pointer is returned through a call to IStorage::EnumElements. If you are doing a custom implementation of a storage object, you need to implement IEnumSTATSTG to fill in a caller-allocated array of STATSTG structures, each of which contains information about the nested elements in the storage object.
When to Use
Containers call methods that return a pointer to IEnumSTATSTG so the container can manage its storage object and the elements within it. Calls to the IStorage::EnumElements method supply a pointer to IEnumSTATDATA. The caller allocates an array of STATSTG structures and the IEnumSTATSTG methods fill in each structure with the statistics about one of the nested elements in the storage object.
The prototypes of the methods are as follows:
HRESULT Next(
ULONG celt,
STATSTG * rgelt,
ULONG * pceltFetched
);
HRESULT Skip(
ULONG celt
);
HRESULT Reset(void)
HRESULT Clone(
IEnumSTATSTG ** ppenum
);
Method | Description |
IEnumSTATSTG::Next | Retrieves a specified number of items in the enumeration sequence. |
IEnumSTATSTG::Skip | Skips over a specified number of items in the enumeration sequence. |
IEnumSTATSTG::Reset | Resets the enumeration sequence to the beginning. |
IEnumSTATSTG::Clone | Creates a copy of the current state of enumeration. |