IStiDevice::Subscribe method (sti.h)

The IStiDevice::Subscribe method registers the caller to receive notifications of device events.

Syntax

HRESULT Subscribe(
  [in, out] LPSTISUBSCRIBE lpSubsribe
);

Parameters

[in, out] lpSubsribe

Caller-supplied pointer to an STISUBSCRIBE structure containing subscription parameter values.

Return value

If the operation succeeds, the method returns S_OK. Otherwise, it returns one of the STIERR-prefixed error codes defined in stierr.h.

Remarks

The IStiDevice::Subscribe method is typically called by applications that intercept events from devices and reroute them. The method allows these applications to be notified of Still Image Device Events so they can then dispatch control to appropriate display applications.

Based on contents supplied in the STISUBSCRIBE structure, the caller can request to be notified of device events by Windows messages or by Win32 events (by means of SetEvent calls).

When the application receives notification of an event, it can call IStiDevice::GetLastNotificationData to find out which event occurred.

Before calling IStiDevice::Subscribe, clients of the IStiDevice COM interface must call IStillImage::CreateDevice to obtain an IStiDevice interface pointer, which provides access to a specified device.

Requirements

Requirement Value
Target Platform Desktop
Header sti.h (include Sti.h)

See also

IStiDevice

IStiDevice::UnSubscribe

IStillImage::LaunchApplicationForDevice