IWiaDevMgr2::CreateDevice method

Creates a hierarchical tree of IWiaItem2 objects for a Windows Image Acquisition (WIA) 2.0 device.

Syntax

HRESULT CreateDevice(
  [in]  LONG      lFlags,
  [in]  BSTR      bstrDeviceID,
  [out] IWiaItem2 **ppWiaItem2Root
);

Parameters

lFlags [in]

Type: LONG

Currently unused. Should be set to zero.

bstrDeviceID [in]

Type: BSTR

Specifies the unique identifier of the WIA 2.0 device.

ppWiaItem2Root [out]

Type: IWiaItem2**

Receives the address of a pointer to the IWiaItem2 interface of the root item in the hierarchical tree for the WIA 2.0 device.

Return value

Type: HRESULT

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

Remarks

Applications use the IWiaDevMgr2::CreateDevice method to create a device object for the WIA 2.0 devices specified by the bstrDeviceID parameter. When it returns, the IWiaDevMgr2::CreateDevice method stores an address of a pointer in the parameter ppWiaItem2Root, which points to the root item of the tree of IWiaItem2 objects created by IWiaDevMgr2::CreateDevice. Applications can use this tree of objects to control and retrieve data from the WIA 2.0 device.

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

Requirements

Requirement Value
Minimum supported client
Windows Vista [desktop apps only]
Minimum supported server
Windows Server 2008 [desktop apps only]
Header
Wia.h
IDL
Wia.idl