IWMSBasicPlugin.InitializePlugin (Visual Basic .NET)
Previous | Next |
IWMSBasicPlugin.InitializePlugin (Visual Basic .NET)
The server calls the InitializePlugin method to initialize a plug-in.
Syntax
Parameters
pServerContext
IWMSContext object containing the server context.
pNamedValues
IWMSNamedValues object containing a collection of properties for the plug-in. The properties can be specified initially during the registration process. For more information, see Registering Plug-in Properties. The properties appear in the server namespace and can be edited by using the IWMSNamedValue object.
pClassFactory
IWMSClassObject that the plug-in can use to create IWMSContext, IWMSCommandContext, IWMSPacket, and IWMSPacketList objects.
Return Values
This method does not return a value. To report an error, the plug-in can throw a COMException object to the server. If the plug-in uses the IWMSEventLog object to log error information, it is recommended that it throw NS_E_PLUGIN_ERROR_REPORTED (0xC00D157D). Typically, the server attempts to make plug-in error information available to the server object model, the Windows Event Viewer, and the troubleshooting list in the details pane of the Windows Media Services MMC. However, if the plug-in uses the IWMSEventLog object to send custom error information to the Windows Event Viewer, throwing NS_E_PLUGIN_ERROR_REPORTED stops the server from also logging to the event viewer. For more information about plug-in error information, see Identifying Plug-in Errors.
Remarks
The InitializePlugin method is implemented by the plug-in and called by the server. The server calls the method only when the plug-in is created. The InitializePlugin and IWMSBasicPlugin.EnablePlugin methods must return before the server can successfully enable and use the plug-in. InitializePlugin is called before EnablePlugin.
Example Code
Public Overloads Sub InitializePlugin( _ ByVal ServerContext As IWMSContext, _ ByVal NamedValues As WMSNamedValues, _ ByVal ClassFactory As IWMSClassObject) _ Implements IWMSBasicPlugin.InitializePlugin ' Store the IWMSClassObject to an internal data ' member for later use. m_ClassFactory = ClassFactory 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, Enterprise Edition; Windows Server 2003, Datacenter Edition; Windows Server 2008.
See Also
Previous | Next |