IDirectMusicPerformance::AllocPMsg

This method allocates a performance message.

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

Parameters

  • cb
    Size of the message structure. For the various types, see Messages.
  • ppPMSG
    Address of a variable to receive 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 memory returned is not initialized to any particular state, with the exception of the pTool member of the DMUS_PMSG structure, which is initialized to 0, and the dwSize member, which is set to the value of cb.

Once the message is sent by IDirectMusicPerformance::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 IDirectMusicTool::Flush or its IDirectMusicTool::ProcessPMsg method. Applications are also responsible for freeing notification messages.

Requirements

OS Versions: Windows CE .NET 4.0 and Windows CE .NET 4.1.
Header: Dmusici.h.
Link Library: Dmusic.lib.

See Also

DirectMusic Messages | IDirectMusicPerformance::FreePMsg | IDirectMusicPerformance::SendPMsg | IDirectMusicTool::Flush | IDirectMusicTool::ProcessPMsg | DMUS_PMSG

 Last updated on Monday, April 12, 2004

© 1992-2002 Microsoft Corporation. All rights reserved.