Share via


IEnumSTATSTG (Compact 2013)

3/26/2014

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.

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 the StgCreateDocfile function, IEnumSTATSTG is implemented on that object, and a pointer is returned through a call to the IStorage::EnumElements method.

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 IEnumSTATSTG.

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  
);

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
StgCreateDocfile
IEnumSTATSTG::Clone
IEnumSTATSTG::Reset
IStorage::EnumElements
STATSTG