Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
.gif)
| Previous | Next |
IWMSPlugin.Status (Visual Basic .NET)
The Status property retrieves the status of the plug-in.
Syntax
Integer = Plugin.Status
Property Value
The bit field of the Integer returned by this property contains an enumeration value from the WMS_PLUGIN_STATUS enumeration type. This must be a logical OR of the following values.
| Value | Description |
| WMS_PLUGIN_NONE | The plug-in is not loaded. |
| WMS_PLUGIN_ERROR | An error has occurred in the plug-in. |
| WMS_PLUGIN_LOADED | The plug-in has been loaded. |
| WMS_PLUGIN_ENABLED | The plug-in has been enabled. |
| WMS_PLUGIN_LOADED_IN_PROC | The plug-in was loaded into the client process. |
| WMS_PLUGIN_LOADED_OUT_OF_PROC | The plug-in was loaded outside of the client process. |
| WMS_PLUGIN_REMOVE_ON_SERVICE_RESTART | The plug-in will be removed when Windows Media Services is restarted. |
Remarks
This property is read-only. When the server starts, plug-ins that are not enabled have a status of WMS_PLUGIN_NONE. When you both load and enable a plug-in, the plug-in status is WMS_PLUGIN_LOADED & WMS_PLUGIN_ENABLED. If the plug-in fails after it has been loaded, the plug-in status is WMS_PLUGIN_LOADED & WMS_PLUGIN_ERROR. When you set the Enabled property to False, the plug-in status is WMS_PLUGIN_LOADED.
When a plug-in error occurs, the Status property on the IWMSServer object indicates that either a critical or non-critical error has occurred. For more information, see the IWMSServer.Status property.
Example Code
Imports Microsoft.WindowsMediaServices.Interop
Imports System.Runtime.InteropServices
Private Sub GetPluginStatus()
' Declare variables.
Dim Server As WMSServer
Dim Plugins As IWMSPlugins
Dim Plugin As IWMSPlugin
Dim iValue As Integer
Dim strText As String
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
iValue = Plugin.ErrorCode
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
- IWMSPlugin Object (Visual Basic .NET)
- IWMSPlugin.ErrorCode (Visual Basic .NET)
- IWMSServer.Status (Visual Basic .NET)
| Previous | Next |