Platform SDK: DirectX

IDirectMusicGraph::InsertTool

The IDirectMusicGraph::InsertTool method inserts a tool in the graph.

HRESULT InsertTool(
  IDirectMusicTool * pTool,
  DWORD * pdwPChannels,
  DWORD cPChannels,
  LONG lIndex
);

Parameters

pTool
Tool to insert.
pdwPChannels
Address of an array of PChannels on which the tool accepts messages. If the tool accepts messages on all PChannels, pass NULL.
cPChannels
Count of how many PChannels are pointed to by pdwPChannels. Ignored if pdwPChannels is NULL.
lIndex
Position at which to place the tool. This is a zero-based index from either the start or (if it is negative) the end of the current tool list. If lIndex is out of range, the tool is placed at the beginning or end of the list. To place a tool at the end of the list, use a number for lIndex that is larger than the number of tools in the current tool list.

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:

DMUS_E_ALREADY_EXISTS
E_OUTOFMEMORY
E_POINTER

Remarks

The reference count of the tool is incremented.

This method calls IDirectMusicTool::Init.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Header: Declared in dmusici.h.