Share via


IWMSPlugin.ErrorText (Visual Basic .NET)

banner art

Previous Next

IWMSPlugin.ErrorText (Visual Basic .NET)

The ErrorText property retrieves the text associated with the plug-in error.

Syntax

  String = Plugin.ErrorText

Property Value

A String containing the text associated with the plug-in error.

If this property fails, it returns an error number.

Number Description
0x8007000E There is insufficient memory to complete the function.

Remarks

This property is read-only. It is valid only if the bit flag is set on the value returned by the IWMSPlugin.Status property. The bit flag identifies the state of the plug-in.

You can use the IWMSLoggingAdmin object to record plug-in errors in the Windows event log. If the event log contains a WMS_EVENT_LOG_LEVEL_ERROR, the HRESULT specified in the IWMSLoggingAdmin object is returned by the get_ErrorCode method.

When you set the Enabled property to False, the ErrorText property is automatically reset to a zero-length string. For more information, see the IWMSPlugin.Enabled property.

Example Code

Imports Microsoft.WindowsMediaServices.Interop
Imports System.Runtime.InteropServices

Private Sub GetErrorInfo()

    ' Declare variables.
    Dim Server As WMSServer
    Dim Plugins As IWMSPlugins
    Dim Plugin As IWMSPlugin
    Dim strText As String
    Dim iValue As Integer

Try
    ' Create the WMSServer object.
    Server = New WMSServer()

    ' Retrieve the IWMSPlugins object.
    Plugins = Server.Authenticators

    ' Retrieve information about each plug-in.
    For Each Plugin In Plugins

        ' Retrieve the current status of the plug-in.
        iValue = Plugin.Status

        ' Retrieve error information if the plug-in
        ' is in error status.
        If iValue = WMS_PLUGIN_STATUS.WMS_PLUGIN_ERROR Then
            strText = Plugin.ErrorText
        End If

    Next

Catch excCom As COMException
    ' TODO: Handle COM exceptions.
Catch exc As Exception
    ' TODO: Handle errors.
Finally
    ' TODO: Clean-up code goes here.
End Try

End Sub

Requirements

Reference: Add a reference to Microsoft.WindowsMediaServices.

Namespace: Microsoft.WindowsMediaServices.Interop.

Assembly: Microsoft.WindowsMediaServices.dll.

Library: WMSServerTypeLib.dll.

Platform: Windows Server 2003 family, Windows Server 2008 family.

See Also

Previous Next