Partager via


IWMDMOperation::SetObjectAttributes

banner art

The SetObjectAttributes method assigns the content attributes. Audio attributes include the number of samples per second, the number of bytes per sample, and so on.

Syntax

HRESULT SetObjectAttributes(
  DWORD  dwAttributes,
  _WAVEFORMATEX*  pFormat
);

Parameters

dwAttributes

[in]  DWORD containing the object attributes as defined in the IWMDMStorage::SetAttributes method.

pFormat

[in]  Pointer to a _WAVEFORMATEX structure containing the format for files with audio data attributes.

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.
WMDM_E_USER_CANCELLED The application instructs Windows Media Device Manager to cancel the current operation without waiting for it to finish.
E_FAIL An unspecified error occurred.

Remarks

This method is called after SetObjectName.

For transferring data from storage, you are passed the attributes of the object being written. If the attributes describe audio data, the pwfFormat structure is filled.

If either E_FAIL or WMDM_E_USER_CANCELLED is returned from this call, the operation is terminated and the End method is called. If the application is using block mode and returns WMDM_E_USER_CANCELLED, then Windows Media Device Manager will return this same error to the application.

Requirements

Header: Defined in wmdm.idl.

Library: mssachlp.lib

See Also