次の方法で共有


IDirectMusicCollection8::EnumInstrument

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 EnumInstrument method retrieves the patch number and name of an instrument by its index in the collection.

Syntax

  
    HRESULT EnumInstrument(
  DWORD 
    dwIndex
    ,
  DWORD* pdwPatch,
  LPWSTR pwszName,
  DWORD dwNameLen
);

Parameters

dwIndex

Index of the instrument in the collection.

pdwPatch

Address of a variable that receives the patch number.

pwszName

Address of a buffer that receives the instrument name. Can be NULL if the name is not wanted.

dwNameLen

Number of WCHAR elements in the instrument name buffer.

Return Values

If the method succeeds, the return value is S_OK, or S_FALSE if there is no instrument with that index number.

If it fails, the method can return one of the error values shown in the following table.

Return code
E_FAIL
E_OUTOFMEMORY
E_POINTER

Remarks

To enumerate all instruments in a collection, start with a dwIndex of 0 and increment until EnumInstrument returns S_FALSE.

Although the ordering of the enumeration is consistent within one instance of a DLS collection, it has no relationship to the ordering of instruments in the file, their patch numbers, or their names.

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.