IWMDMDevice3::SetProperty method (mswmdm.h)

The SetProperty method sets a specific device property, if it is writable.

Syntax

HRESULT SetProperty(
  [in] LPCWSTR           pwszPropName,
  [in] const PROPVARIANT *pValue
);

Parameters

[in] pwszPropName

A wide character, null-terminated string name of the property to set. This overwrites any existing property with the same name. Once the application has made this call, it should free any dynamic memory using PropVariantClear. A list of standard property name constants is given in Metadata Constants.

[in] pValue

Value of the property being set.

Return value

The method returns an HRESULT. All the interface methods in Windows Media Device Manager 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 an extensive list of possible error codes, see Error Codes.

Remarks

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

For the list of device property names, see Metadata Constants.

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

Requirement Value
Target Platform Windows
Header mswmdm.h
Library Mssachlp.lib

See also

Enumerating Devices

IWMDMDevice3 Interface

IWMDMDevice3::GetProperty

IWMDMStorage3::SetMetadata

IWMDMStorage4::GetSpecifiedMetadata

Setting Metadata on a File