Compartir a través de


Propiedad IWMPError::errorCount

[La característica asociada a esta página, Reproductor multimedia de Windows SDK, es una característica heredada. Se ha reemplazado por MediaPlayer. MediaPlayer se ha optimizado para Windows 10 y Windows 11. Microsoft recomienda encarecidamente que el nuevo código use MediaPlayer en lugar de Reproductor multimedia de Windows SDK, siempre que sea posible. Microsoft sugiere que el código existente que usa las API heredadas se reescriba para usar las nuevas API si es posible.

La propiedad errorCount obtiene el número de errores en la cola de errores.

Sintaxis

public System.Int32 errorCount {get; set;}

Public ReadOnly Property errorCount As System.Int32

Valor de propiedad

System.Int32 que es el número de errores.

Observaciones

Debe establecer IWMPSettings.enableErrorDialogs en false si decide mostrar mensajes de error personalizados.

Ejemplos

En el ejemplo siguiente se usa errorCount en un controlador de eventos error para alertar al usuario sobre el error más reciente en la cola de errores. El objeto AxWMPLib.AxWindowsMediaPlayer se representa mediante la variable denominada 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 Value
Versión
Reproductor multimedia de Windows serie 9 o posterior
Espacio de nombres
WMPLib
Ensamblado
Interop.WMPLib.dll (Interop.WMPLib.dll.dll)

Consulte también

Interfaz IWMPError (VB y C#)

IWMPSettings.enableErrorDialogs (VB y C#)