Freigeben über


IDirectMusicCollection8::GetInstrument

Warning: This technology is deprecated as is all of DirectMusic. Deprecated components are considered obsolete. While these components are still supported, they may be removed in the future. When writing new applications, you should avoid using these deprecated components. When modifying existing applications, you are strongly encouraged to remove any dependency on these components.
Deprecated.

The GetInstrument method retrieves an instrument by its patch number.

Syntax

  
    HRESULT GetInstrument(
  DWORD 
    dwPatch
    ,
  IDirectMusicInstrument** ppInstrument
);

Parameters

dwPatch

Instrument patch number.

ppInstrument

Address of a variable that receives a pointer to the IDirectMusicInstrument8 interface.

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_INVALIDPATCH
E_FAIL
E_OUTOFMEMORY
E_POINTER

Remarks

The patch number passed in dwPatch describes the full patch address, including the MIDI parameters for MSB and LSB bank select. MSB is shifted left 16 bits, and LSB is shifted left 8 bits. In addition, the high bit is set (0x80000000) if the instrument is specifically a drum kit intended to be played on MIDI channel 10.

Requirements

**  Minimum Supported Client:** Windows 2000.
**  Minimum Supported Server:** Windows 2000 Server.

**  Header:** Dmusicc.h
  Library: Dmusic.h

See Also

© 2004 Microsoft Corporation. All rights reserved.