Share via


Propriedade IWMPError::errorCount

[O recurso associado a esta página, Reprodutor Multimídia do Windows SDK, é um recurso herdado. Foi substituído pelo MediaPlayer. O MediaPlayer foi otimizado para Windows 10 e Windows 11. A Microsoft recomenda fortemente que o novo código use o MediaPlayer em vez de Reprodutor Multimídia do Windows SDK, quando possível. A Microsoft sugere que o código existente que usa as APIs herdadas seja reescrito para usar as novas APIs, se possível.]

A propriedade errorCount obtém o número de erros na fila de erros.

Sintaxe

public System.Int32 errorCount {get; set;}

Public ReadOnly Property errorCount As System.Int32

Valor da propriedade

Um System.Int32 que é o número de erros.

Comentários

Você deve definir IWMPSettings.enableErrorDialogs como false se optar por exibir mensagens de erro personalizadas.

Exemplos

O exemplo a seguir usa errorCount em um manipulador de eventos Error para alertar o usuário sobre o erro mais recente na fila de erros. O objeto AxWMPLib.AxWindowsMediaPlayer é representado pela variável chamada player.

private void player_ErrorEvent_errorCount(object sender, System.EventArgs e)
{
    // Store the number of errors in the queue.
    int 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.
    string errDesc = player.Error.get_Item(max-1).errorDescription;

    // Display the error description.
    System.Windows.Forms.MessageBox.Show(errDesc);
}

Public Sub player_ErrorEvent_errorCount(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

    ' 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.
    Dim errDesc As String = player.Error.Item(max - 1).errorDescription

    ' Display the error description.
    System.Windows.Forms.MessageBox.Show(errDesc)

End Sub

Requisitos

Requisito Valor
Versão
série Reprodutor Multimídia do Windows 9 ou posterior
Namespace
WMPLib
Assembly
Interop.WMPLib.dll (Interop.WMPLib.dll.dll)

Confira também

Interface IWMPError (VB e C#)

IWMPSettings.enableErrorDialogs (VB e C#)