IWMSActiveScriptAdmin.ErrorCharacterPosition (C#)

banner art

Previous Next

IWMSActiveScriptAdmin.ErrorCharacterPosition (C#)

The ErrorCharacterPosition property retrieves the character position of the last error that occurred in the script when loaded by the script engine.

Syntax

  int = IWMSActiveScriptAdmin.ErrorCharacterPosition;

Property Value

int containing the character position of the error.

Remarks

This property is read-only.

Example Code

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

// Declare variables.
WMSServer Server;
IWMSPlugin Plugin;
IWMSActiveScriptAdmin ActiveScriptAdmin;

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

    // Retrieve the plug-in to be configured.
    Plugin = Server.EventHandlers[
                    "WMS Active Script Event Handler"];

    // Retrieve the custom interface of the plug-in.
    ActiveScriptAdmin =
        (IWMSActiveScriptAdmin)Plugin.CustomInterface;

    // Retrieve the position of the last known script error.
    int iErrorPos = ActiveScriptAdmin.ErrorCharacterPosition;
}
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