Microsoft DirectX 8.0 (C++)

IDirectMusicPerformance8::AllocPMsg

Allocates a performance message.

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 following error values:

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: Declared in dmusici.h.

See Also

IDirectMusicPerformance8::FreePMsg, IDirectMusicPerformance8::SendPMsg, DirectMusic Messages