ISensorManager::GetSensorByID method
Retrieves a pointer to the specified sensor.
Syntax
HRESULT GetSensorByID(
[in] REFSENSOR_ID sensorID,
[out] ISensor **ppSensor
);
Parameters
- sensorID [in]
-
The ID of the sensor to retrieve.
- ppSensor [out]
-
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 |
|---|---|
|
The method succeeded. |
|
The sensor manager found more than one sensor with the same ID. |
|
No sensor is available for the specified ID. |
|
NULL was passed in for ppSensor. |
Examples
The following example code shows how to retrieve a sensor by using its ID.
ISensor* pSensor = NULL;
// Get the sensor collection.
hr = pSensorManager->GetSensorByID(SAMPLE_SENSOR_TIME_ID, &pSensor);
Requirements
|
Minimum supported client | Windows 7 [desktop apps only] |
|---|---|
|
Minimum supported server | None supported [desktop apps only] |
|
Header |
|
|
Library |
|
|
DLL |
|
See also
Build date: 11/19/2012