IWMSClassObject::AllocIWMSCommandContext

banner art

Previous Next

IWMSClassObject::AllocIWMSCommandContext

The AllocIWMSCommandContext method allocates a command context.

Syntax

  

Parameters

riid

[in] REFIID containing the command context GUID. This must be equal to IID_IWMSCommandContext.

pRelatedContext

[in] Pointer to a related context. This can be NULL. However, it is recommended that you pass a pointer to the user context. Because a command context is associated with a particular user, passing the user context enables the server to use the same critical section for both contexts, thereby minimizing the number of critical sections required and decreasing the risk of deadlocks.

ppunk

[out] Pointer to a pointer to an IWMSCommandContext interface.

Return Values

If the method succeeds, it returns S_OK. If it fails, it returns an HRESULT error code.

Return code Number Description
E_INVALIDARG 0x80070057 The ppunk parameter is NULL.
E_OUTOFMEMORY 0x8007000E There was not enough memory to create the command context.

Remarks

The server sends your plug-in a pointer to the IWMSClassObject interface when it calls the IWMSBasicPlugin::InitializePlugin method.

If you are allocating a command context, it is more efficient to call this method than it is to call IWMSClassObject::CreateInstance.

Example Code

  if (FAILED(hr)) goto EXIT;

EXIT:
    // TODO: Release temporary objects.

Requirements

Header: nsscore.h.

Library: WMSServerTypeLib.dll.

Platform: Windows Server 2003, Enterprise Edition; Windows Server 2003, Datacenter Edition; Windows Server 2008.

See Also

Previous Next