IWiaDevMgr::CreateDevice method (wia_xp.h)

The IWiaDevMgr::CreateDevice creates a hierarchical tree of IWiaItem objects for a Windows Image Acquisition (WIA) device.

Syntax

HRESULT CreateDevice(
  [in]  BSTR     bstrDeviceID,
  [out] IWiaItem **ppWiaItemRoot
);

Parameters

[in] bstrDeviceID

Type: BSTR

Specifies the unique identifier of the WIA device.

[out] ppWiaItemRoot

Type: IWiaItem**

Pointer to a pointer to the IWiaItem interface of the root item in the hierarchical tree for the WIA device.

Return value

Type: HRESULT

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

Remarks

Applications use the IWiaDevMgr::CreateDevice method to create a device object for the WIA devices specified by the bstrDeviceID parameter.

When it returns, the IWiaDevMgr::CreateDevice method stores an address of a pointer in the parameter ppWiaItemRoot. The pointer points to the root item of the tree of IWiaItem objects created by IWiaDevMgr::CreateDevice. Applications can use this tree of objects to control and retrieve data from the WIA device.

Note that applications must call the IUnknown::Release method on the pointers they receive through the ppWiaItemRoot 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