IWMDMDevice3::SetProperty

banner art

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

Syntax

HRESULT SetProperty(LPCWSTRpwszPropName,PROPVARIANT*pValue);

Parameters

pwszPropName

[in]  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.

pValue

[in]  Value of the property being set.

Return Values

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 extenstive 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 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

Header: Defined in mswmdm.h.

Library: mssachlp.lib

See Also