Share via


IWMSPlugin.ErrorText (C#)

banner art

Previous Next

IWMSPlugin.ErrorText (C#)

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 throws an exception.

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

using Microsoft.WindowsMediaServices.Interop;
using System.Runtime.InteropServices;

// Declare variables.
WMSServer          Server;
IWMSPlugins        Plugins;
IWMSPlugin         Plugin;

int               iValue;
string             strText;

try {
    // Create a new WMSServer object.
    Server = new WMSServerClass();

    // Retrieve the IWMSPlugins object.
    Plugins = Server.Authenticators;

    // Retrieve information about each plug-in.
    for (int i = 0; i < Plugins.Count; i++)
    {
        Plugin = Plugins[i];

        // 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)
        {
            strText = Plugin.ErrorText;
        }
    }
}
catch (COMException comExc) {
    // TODO: Handle COM exceptions.
}
catch (Exception e) {
    // TODO: Handle exceptions.
}

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