IDirectMusicPerformance8::AllocPMsg

The AllocPMsg method allocates memory for a performance message.

Syntax

HRESULT AllocPMsg(
  ULONG cb,
  DMUS_PMSG** ppPMSG
);

Parameters

cb

Size of the message structure. This structure is of a type derived from DMUS_PMSG.

ppPMSG

Address of a variable that receives the pointer to the allocated message structure.

Return Values

If the method succeeds, the return value is S_OK.

If it fails, the method can return one of the error values shown in the following table.

Return code
E_INVALIDARG
E_OUTOFMEMORY
E_POINTER

Remarks

The dwSize member of the message structure is set to the value of cb. Other members are not necessarily initialized to zero, because of internal caching.

After the message is sent by IDirectMusicPerformance8::SendPMsg, the application no longer owns the memory and is not responsible for freeing the message. However, a tool can free a message within its IDirectMusicTool8::Flush or its IDirectMusicTool8::ProcessPMsg method. Applications are also responsible for freeing notification messages.

Requirements

**  Header:** Dmusici.h
  Library: Dmime.dll, Dmimed.dll

See Also

© 2004 Microsoft Corporation. All rights reserved.