Partager via


IWMDMObjectInfo::GetLongestPlayPosition

banner art

The GetLongestPlayPosition method retrieves the longest play position of the file. The file must be an audio file on the media device.

Syntax

HRESULT GetLongestPlayPosition(DWORD*pdwLongestPos);

Parameters

pdwLongestPos

[out]  Pointer to a DWORD specifying the longest play position of the object, in milliseconds.

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.
WMDM_E_NOTSUPPORTED This object cannot report longest play position.
E_INVALIDTYPE The object is not a valid playable file.
E_FAIL An unspecified error occurred.

Remarks

The object must be an audio data file. For all other object types, this function returns E_INVALIDTYPE.

The last play position changes when either the user starts playing a file on the media device, or when an application invokes the IWMDMDeviceControl::Play method and that play exceeds the position of the last longest play position.

Requirements

Header: Defined in mswmdm.h.

Library: mssachlp.lib

See Also