Bewerken

Delen via


ISensorDriver::OnSetProperties method (sensorsclassextension.h)

The ISensorDriver::OnSetProperties method specifies values for the specified list of properties.

Syntax

HRESULT OnSetProperties(
  [in]  IWDFFile              *pClientFile,
  [in]  LPWSTR                pwszSensorID,
  [in]  IPortableDeviceValues *pPropertiesToSet,
  [out] IPortableDeviceValues **ppResults
);

Parameters

[in] pClientFile

Pointer to an IWDFFile interface that represents the file object for the application specifying property values.

[in] pwszSensorID

LPWSTR that contains the ID for the sensor for which the client application is specifying property values.

[in] pPropertiesToSet

Pointer to an IPortableDeviceValues interface that contains the list of properties to set and their values.

[out] ppResults

Address of an IPortableDeviceValues pointer that receives the list of properties that have been set successfully and their new values. If a property was not set, the new value contains an HRESULT error code.

Return value

If the operation succeeds, this method returns S_OK. Otherwise, this method returns one of the error codes that are defined in Winerror.h.

Remarks

Properties describe the sensor device, as opposed to data fields, which contain sensor-generated data. Platform-defined properties are defined in sensors.h.

The list of properties provided through pPropertiesToSet is typically a subset of the list you returned through ISensorDriver::OnGetSupportedProperties. However, the sensor class extension does not enforce this condition on client applications.

The sensor class extension is responsible for freeing any PROPVARIANT structures returned by this method.

IPortableDeviceValues is documented in Windows Portable Devices.

Note  This method will be called only if the user has enabled the sensor in the Location and Other Sensors control panel.
 

Requirements

Requirement Value
Minimum supported client Windows 7,Available in Windows 7.
Minimum supported server None supported
Target Platform Desktop
Header sensorsclassextension.h
Library SensorsClassExtension.lib

See also

ISensorDriver

ISensorDriver::OnGetProperties