IWiaItem2::EnumChildItems method

Creates an enumerator object and passes back a pointer to its IEnumWiaItem2 interface for folders with items in the IWiaItem2 tree of a Windows Image Acquisition (WIA) 2.0 device.


HRESULT EnumChildItems(
  [in]  const GUID          *pCategoryGUID,
  [out]       IEnumWiaItem2 **ppIEnumWiaItem2


pCategoryGUID [in]

Type: const GUID*

Specifies a pointer to a category for which child nodes are enumerated. If NULL, then all child nodes are enumerated.

ppIEnumWiaItem2 [out]

Type: IEnumWiaItem2**

Receives the address of a pointer to the IEnumWiaItem2 interface that this method creates.

Return value


If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.


The WIA 2.0 run-time system represents each WIA 2.0 hardware device as a hierarchical tree of IWiaItem2 objects. The IWiaItem2::EnumChildItems method enables applications to enumerate child items in the current item. However, it can only be applied to items that are folders.

If the folder is not empty, it contains a subtree of IWiaItem2 objects. The IWiaItem2::EnumChildItems method enumerates all of the items contained in the folder. It stores a pointer to an enumerator in the ppIEnumWiaItem2 parameter. Applications use the enumerator pointer to perform the enumeration of an object's child items.

Applications must call the IUnknown::Release method on the interface pointers they receive through the ppIEnumWiaItem2 parameter.


Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]