Bagikan melalui


DeviceManager.RegisterEvent method

Registers the specified EventID Constants for the specified DeviceID. If DeviceID is "*" then OnEvent is called whenever the event specified occurs for any device. Otherwise, OnEvent is only called if the event specified occurs on the device specified.

Syntax

DeviceManager.RegisterEvent( _
  ByVal EventID As BSTR, _
  [ ByVal DeviceID As BSTR ] _
) As HRESULT

Parameters

EventID [in]

Type: BSTR

Required. String value.

DeviceID [in, optional]

Type: BSTR

String value.

Value Meaning
*
Default.

Return value

Type: HRESULT

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

Remarks

[!Warning]
Using the IWiaDevMgr::RegisterEventCallbackInterface, IWiaDevMgr2::RegisterEventCallbackInterface, and DeviceManager.RegisterEvent methods from the same process after the Still Image Service is restarted may cause an access violation, if the functions were used before the service was stopped.

For example code, see Download New Items as They are Created in Shared Samples.

Requirements

Minimum supported client
Windows Vista [desktop apps only]
Minimum supported server
Windows Server 2003 R2 [desktop apps only]
Header
Wiaaut.h
IDL
Wiaaut.idl

See also

Reference

DeviceID (Device)

EventID

DeviceID (DeviceInfo)

DeviceManager

OnEvent

RegisterPersistentEvent

UnregisterEvent

UnregisterPersistentEvent

EventID Constants