ISensorManager::GetSensorByID method (sensorsapi.h)

Retrieves a pointer to the specified sensor.

Syntax

HRESULT GetSensorByID(
  [in]  REFSENSOR_ID sensorID,
  [out] ISensor      **ppSensor
);

Parameters

[in] sensorID

The ID of the sensor to retrieve.

[out] ppSensor

Address of an ISensor interface pointer that receives a pointer to the requested sensor. Will be NULL if the requested sensor cannot be found.

Return value

The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.

Return code Description
S_OK
The method succeeded.
E_UNEXPECTED
The sensor manager found more than one sensor with the same ID.
HRESULT_FROM_WIN32(ERROR_NOT_FOUND)
No sensor is available for the specified ID.
E_POINTER
NULL was passed in for ppSensor.

Requirements

Requirement Value
Minimum supported client Windows 7 [desktop apps only]
Minimum supported server None supported
Target Platform Windows
Header sensorsapi.h
Library Sensorsapi.lib
DLL Sensorsapi.dll

See also

ISensorManager

Retrieving a Sensor Object