Export (0) Print
Expand All

ISensorEvents::OnEvent method

Provides custom event notifications.

Syntax


HRESULT OnEvent(
  [in]  ISensor *pSensor,
  [in]  REFGUID eventID,
  [in]  IPortableDeviceValues *pEventData
);

Parameters

pSensor [in]

Pointer to the ISensor interface that represents the sensor that raised the event.

eventID [in]

REFGUID that identifies the event.

pEventData [in]

Pointer to the IPortableDeviceValues interface that contains the event data.

Return value

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

Remarks

This callback method receives custom event notifications. Custom events are defined by sensor providers. Platform-defined event IDs are defined in Sensors.h.

To receive new data from a sensor, use the OnDataUpdated Method.

Examples

For an example of how to receive sensor events, see Using Sensor API Events.

Requirements

Minimum supported client

Windows 7 [desktop apps only]

Minimum supported server

None supported

Header

Sensorsapi.h

Library

Sensorsapi.lib

DLL

Sensorsapi.dll

See also

ISensorEvents

 

 

Community Additions

ADD
Show:
© 2014 Microsoft