Share via


IWMSClassObject.AllocIWMSCommandContext (Visual Basic .NET)

banner art

Previous Next

IWMSClassObject.AllocIWMSCommandContext (Visual Basic .NET)

The AllocIWMSCommandContext method allocates an IWMSCommandContext object.

Syntax

  

Parameters

riid

Reference to a Guid containing the data structure IID. This must be equal to IID_IWMSCommandContext.

pRelatedContext

Object containing a related context object. This object can be Nothing.

ppunk

Reference to an IntPtr containing an IWMSCommandContext object.

Return Values

This method does not return a value.

If this method fails, it throws an exception.

Number Description
0x80070057 ppunk is null.
0x8007000E There is insufficient memory to complete the function.

Remarks

The pRelatedContext parameter points to an IWMSCommandContext object. A command context contains requests by the client and responses by the server. To increase performance, the server can share critical sections between command contexts Each plug-in is passed the user context to create a component per user (client/data path). This user context should be passed as the pRelatedContext so they can share critical sections.

Example Code

Dim CmdContext As IWMSCommandContext
Dim CmdRequest As IWMSContext
Dim pUnknown As IntPtr

Try
    m_ClassFactory.AllocIWMSCommandContext( _
                                       GetType(IWMSCommandContext).GUID, _
                                       pUserContext, _
                                       pUnknown)
    CmdContext = Marshal.GetTypedObjectForIUnknown(pUnknown, _
                                           GetType(IWMSCommandContext))
    CmdContext.GetCommandRequest(CmdRequest)

Catch e As Exception
    ' TODO: Handle exceptions.
End Try

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