Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
.gif)
| Previous | Next |
IWMPError.clearErrorQueue (VB and C#)
The clearErrorQueue method clears the errors from the error queue.
[Visual Basic] Sub clearErrorQueue() [C#] void clearErrorQueue ();
Parameters
This method takes no parameters.
Return Value
This method does not return a value.
Remarks
Use this method to clear the error queue after a series of errors has been processed.
You should set IWMPSettings.enableErrorDialogs to false if you choose to display custom error messages.
Example Code
The following example uses clearErrorQueue in an Error event handler to empty the error queue after all error descriptions have been displayed. The AxWMPLib.AxWindowsMediaPlayer object is represented by the variable named player.
[Visual Basic]
Public Sub player_ErrorEvent_clearErrorQueue(ByVal sender As Object, ByVal e As System.EventArgs) Handles player.ErrorEvent
' Store the number of errors in the queue.
Dim max As Integer = player.Error.errorCount
' Loop through the list of errors.
For i As Integer = 0 To (max - 1)
' Get the description for this error.
Dim errDesc As String = player.Error.Item(i).errorDescription
' Display the error message.
System.Windows.Forms.MessageBox.Show(errDesc)
Next i
' Clear the error queue to prepare for the next group of errors.
player.Error.clearErrorQueue()
End Sub
FakePre-926b099c40ba42c6af44dff4594e1e7b-a2fb0ac8d4234855837f36d04cc04261
private void player_ErrorEvent_clearErrorQueue(object sender, System.EventArgs e)
{
// Store the number of errors in the queue.
int max = player.Error.errorCount;
// Loop through the list of errors.
for (int i = 0; i < max; i++)
{
// Get the description for this error.
string errDesc = player.Error.get_Item(i).errorDescription;
// Display the error message.
System.Windows.Forms.MessageBox.Show(errDesc);
}
// Clear the error queue to prepare for the next group of errors.
player.Error.clearErrorQueue();
}
Requirements
Version: Windows Media Player 9 Series or later
Namespace: WMPLib
Assembly: Interop.WMPLib.dll (automatically generated by Visual Studio)
See Also
| Previous | Next |