|Microsoft DirectX 9.0|
The EnumInstrument method retrieves the patch number and name of an instrument by its index in the collection.
HRESULT EnumInstrument( DWORD dwIndex, DWORD* pdwPatch, LPWSTR pwszName, DWORD dwNameLen );
Index of the instrument in the collection.
Address of a variable that receives the patch number.
Address of a buffer that receives the instrument name. Can be NULL if the name is not wanted.
Number of WCHAR elements in the instrument name buffer.
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.
To enumerate all instruments in a collection, start with a dwIndex of 0 and increment until EnumInstrument returns S_FALSE.
The patch number returned in pdwPatch describes the full patch address, including the MIDI parameters for MSB and LSB bank select. For more information, see MIDI Channel Messages.
Although the ordering of the enumeration is consistent within one instance of a
For an example of instrument enumeration, see Working with Instruments.
Header: Declared in dmusicc.h.