IWMPErrorItem::errorCode property
[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 errorCode property gets the current error code.
Syntax
public System.Int32 errorCode {get; set;}
Public ReadOnly Property errorCode As System.Int32
Property value
A System.Int32 that is the error code.
Remarks
You should set IWMPSettings.enableErrorDialogs to false if you choose to display custom error messages.
Examples
The following example uses errorCode in an Error event handler to display the error code to the user. The AxWMPLib.AxWindowsMediaPlayer object is represented by the variable named player.
private void player_ErrorEvent_errorCode(object sender, System.EventArgs e)
{
// Get the error code for the first error item.
int errCode = player.Error.get_Item(0).errorCode;
// Display the error code.
System.Windows.Forms.MessageBox.Show("Error number: " + errCode.ToString());
}
Public Sub player_ErrorEvent_errorCode(ByVal sender As Object, ByVal e As System.EventArgs) Handles player.ErrorEvent
' Get the error code for the first error item.
Dim errCode As Integer = player.Error.Item(0).errorCode
' Display the error code.
System.Windows.Forms.MessageBox.Show("Error number: " + errCode.ToString())
End Sub
Requirements
Requirement | Value |
---|---|
Version |
Windows Media Player 9 Series or later |
Namespace |
WMPLib |
Assembly |
|