Κοινή χρήση μέσω


Error.clearErrorQueue method

[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 clearErrorQueue method clears the errors from the error queue.

Syntax

Error.clearErrorQueue()

Parameters

This method has no parameters.

Return value

This method does not return a value.

Remarks

This method is useful to clear the error queue after a series of errors has been processed.

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

Examples

The following JScript example uses Error.clearErrorQueue in an event handler to empty the error queue after all error descriptions are displayed. 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 

// Loop through the list of errors.
for (var i = 0; i < max; i++){
    // Get the error description for this item.
    var errDesc = Player.error.item(i).errorDescription;
    
    // Display the error message.
    alert(errDesc);
}

// Clear the error queue to prepare for the next group of errors.
Player.error.clearErrorQueue();

</SCRIPT>

Requirements

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

See also

Error Object