IWMSClassObject.AllocIWMSCommandContext (Visual Basic .NET)

The AllocIWMSCommandContext method allocates an IWMSCommandContextIWMSCommandContext Object (Visual Basic .NET).

IWMSClassObject.AllocIWMSCommandContext(  ByRef riid As Guid,
  pRelatedContext As Object,
  ByRef ppunk As IntPtr
)

Arguments

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

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

Reference to an IntPtr containing an IWMSCommandContext object.

Return Value

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

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

Concepts

IWMSClassObject Object (Visual Basic .NET)