Share via


IWMDMDevice3::SetProperty

banner art

The SetProperty method sets a specific device property that is writable.

Syntax

HRESULT SetProperty(
  LPCWSTR  pwszPropName,
  PROPVARIANT*  pValue
);

Parameters

pwszPropName

[in]  Name of the property being set.

pValue

[in]  Value of the property being set.

Return Values

The method returns an HRESULT. All the interface methods in Windows Media Device Manager and service provider can return any of the following classes of error codes:

  • Standard COM error codes
  • Windows error codes converted to HRESULT values
  • Windows Media Device Manager error codes

For a complete list of possible error codes, see Error Codes.

Possible values include, but are not limited to, those in the following table.

Return code Description
S_OK The method succeeded.
E_INVALIDARG One or both parameters are NULL.
WMDM_E_NOTSUPPORTED The property is not supported by the device, or this property is not settable, or the device returned an error.

Remarks

This method sets the specified device property. To obtain the list of supported device properties, the client should query the g_wszWMDMSupportedDeviceProperties property by calling the IWMDMDevice3::GetProperty method.

For the list of device property names, see Device Properties.

This method is similar to the SetMetadata method for storages, but this method can set only one property at one time.

Not all properties of the device can be set.

Requirements

Header: Defined in wmdm.idl.

Library: mssachlp.lib

See Also