IVIO_Device::SetNotify

This method provides the means to add a notification sink to a specified device. Through this sink, the device can send a notification to an application on a timed basis.

Syntax

HRESULT IVIO_Device::SetNotify ( const LPVARIANT pParameterData, IVIO_EventSink *pEventSink, DWORD dwFreq );

Parameters

pParameterData
[in] Pointer to a VARIANT structure that contains additional information for starting the notification. This would be the same information that a device component would require for input on a call to the GetData method.
pEventSink
[in] Pointer to an IVIO_EventSink interface. This interface’s method is called by the device at notification time. If the value is NULL, then the event sink is removed from the device component.
dwFreq
[out] Specifies, in milliseconds, the frequency at which the application should be notified by the device. This value should not be less than 500 milliseconds.

Return Values

One of the values described in the following table is returned.

Value
Description
S_OK Notification sink was successfully added to the device.
E_NOTIMPL The SetNotify method is not implemented for the device component. This may result if only write access is available on the device component.
E_POINTER The pEventSink pointer is invalid.
E_ACCESSDENIED A notification sink is already in place for the device component, or the device has exclusive read access.
E_UNEXPECTED An unexpected error occurred while trying to add the notification sink to the device component.