Partager via


Error.errorCount

[The feature associated with this page, Windows Media Player SDK, is a legacy feature. It has been superseded by MediaPlayer. MediaPlayer has been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer instead of Windows Media Player SDK, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

The errorCount property retrieves the number of errors in the error queue.

player.error.errorCount
      

Possible Values

This property is a read-only Number (long).

Remarks

You should set Settings.enableErrorDialogs to false if you choose to display custom error messages.

Examples

The following JScript example uses Error.errorCount in an event handler to alert the user about the most recent error in the error queue. The Player object was created with ID = "Player".

<SCRIPT LANGUAGE = "JScript"  FOR = Player  EVENT = error()>

// Store the number of errors in the queue.
var max = Player.error.errorCount;

// Get the description of the last error. Error items start at zero,
// so the item index will always be one less than the error count.
var errDesc = Player.error.item(max-1).errorDescription;

// Display the error description.
alert(errDesc);

</SCRIPT>

Requirements

Requirement Value
Version
Windows Media Player version 7.0 or later.
DLL
Wmp.dll

See also

Error Object