IWiaItem::CreateChildItem method (wia_xp.h)

The IWiaItem::CreateChildItem method is used by applications to add IWiaItem objects to the IWiaItem tree of a device.

Syntax

HRESULT CreateChildItem(
  [in]  LONG     lFlags,
  [in]  BSTR     bstrItemName,
  [in]  BSTR     bstrFullItemName,
  [out] IWiaItem **ppIWiaItem
);

Parameters

[in] lFlags

Type: LONG

Specifies the WIA item type. Must be set to one of the values listed in WIA Item Type Flags.

[in] bstrItemName

Type: BSTR

Specifies the WIA item name, such as "Top". You can think of this parameter as being equivalent to a file name.

[in] bstrFullItemName

Type: BSTR

Specifies the full WIA item name. You can think of this parameter as equivalent to a full path to a file, such as "003\Root\Top".

[out] ppIWiaItem

Type: IWiaItem**

Receives the address of a pointer to the IWiaItem interface that sets the IWiaItem::CreateChildItem method.

Return value

Type: HRESULT

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

Remarks

Some WIA hardware devices allow applications to create new items in the IWiaItem tree that represents the device. Applications must test the devices to see if they support this capability. Use the IEnumWIA_DEV_CAPS interface to enumerate the current device's capabilities.

If the device allows the creation of new items in the IWiaItem tree, invoking IWiaItem::CreateChildItem creates a new IWiaItem that is a child of the current node. IWiaItem::CreateChildItem passes a pointer to the new node to the application through the ppIWiaItem parameter.

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

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional, Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header wia_xp.h (include Wia.h)
Library Wiaguid.lib
DLL Wiaservc.dll