Microsoft DirectX 9.0 SDK Update (October 2004)

IDirectMusicGraph8::InsertTool

The InsertTool method inserts a tool in the graph.

Note   Do not use or distribute tools from untrusted sources. Tools can contain unsafe code.

Syntax

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

Parameters

pTool

Tool to insert.

pdwPChannels

Address of an array of performance channels on which the tool accepts messages. If the tool accepts messages on all channels, pass NULL.

cPChannels

Count of how many channels 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 the start of the current tool list or, if it is negative, from the end of the 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 value 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 error values shown in the following table.

Return code
DMUS_E_ALREADY_EXISTS
E_OUTOFMEMORY
E_POINTER

Remarks

The reference count of the tool is incremented.

This method calls IDirectMusicTool8::Init.

Requirements

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

See Also


© 2004 Microsoft Corporation. All rights reserved.