IWMSPlugin.Enabled (Visual Basic .NET)
.gif)
| Previous | Next |
IWMSPlugin.Enabled (Visual Basic .NET)
The Enabled property specifies and retrieves a Boolean value indicating whether the plug-in is enabled.
Syntax
Plugin .Enabled = Boolean Boolean = Plugin.Enabled
Property Value
A Boolean indicating whether the plug-in is enabled. By default, this parameter is False.
If this property fails, it returns an error number.
| Number | Description |
| 0x0000052E | This can be returned by the WMS Anonymous User Authentication plug-in to indicate that the user name or password set through its custom administration interface does not match the settings for the Windows user account that is used for anonymous guests. |
| 0xC00D1454L | The plug-in does not support loading as either an in-process or an out-of-process component. |
| 0xC00D157CL | This can be returned by the WMS Active Script Event Handler plug-in to indicate that it was unable to find a script engine to run the script indicated by its FileName property. |
| 0xC00D1457L | The plug-in cannot be enabled or disabled while the publishing point is running. |
| 0xC00D1456L | Only one multicast data writer plug-in can be enabled on a publishing point. |
Remarks
When you call the Enabled property, the server will load the plug-in if it is not already loaded. Because the Enabled property is persistent, it may not reflect the current status of the plug-in if the status changes after Enabled is called. Use the IWMSPlugin.Status property to retrieve the plug-in status.
Example Code
Imports Microsoft.WindowsMediaServices.Interop
Imports System.Runtime.InteropServices
Private Sub EnablePlugin()
' Declare variables.
Dim Server As WMSServer
Dim Plugins As IWMSPlugins
Dim Plugin As IWMSPlugin
Dim bEnabled As Boolean
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 a Boolean value indicating whether
' the plug-in is enabled.
bEnabled = Plugin.Enabled
' Set a Boolean value indicating that
' the plug-in is enabled.
Plugin.Enabled = True
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
- IWMSPlugin Object (Visual Basic .NET)
- IWMSPlugin.Enabled (Visual Basic .NET)
- IWMSPlugin.Status (Visual Basic .NET)
- IWMSPlugins Object (Visual Basic .NET)
| Previous | Next |