|Microsoft DirectX 9.0|
The DownloadInstrument method downloads
HRESULT DownloadInstrument( IDirectMusicInstrument* pInst, DWORD dwPChannel, IDirectMusicDownloadedInstrument** ppDownInst, DMUS_NOTERANGE* pNoteRanges, DWORD dwNumNoteRanges, IDirectMusicPort** ppPort, DWORD* pdwGroup, DWORD* pdwMChannel );
Pointer to the IDirectMusicInstrument8 interface of the instrument to download.
Address of a variable that receives an IDirectMusicDownloadedInstrument8 pointer to the downloaded instrument.
Address of an array of DMUS_NOTERANGE structures. Each entry in the array specifies a contiguous range of MIDI note messages to which the instrument must respond. An instrument region is downloaded only if at least one note in that region is specified in the DMUS_NOTERANGE structures.
Number of DMUS_NOTERANGE structures in the array pointed to by pNoteRanges. If this value is set to 0, the pNoteRanges parameter is ignored, and all regions are downloaded.
Address of a variable that receives a pointer to the port to which the instrument was downloaded.
Address of a variable that receives the channel group to which the instrument was assigned.
Address of a variable that receives the MIDI channel to which the instrument was assigned.
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.
Most applications do not need to use this method, because instrument downloading is normally handled by bands.
The method returns E_INVALIDARG if the performance channel is not assigned to a port.
To prevent loss of resources, unload the instrument by using the IDirectMusicPort8::UnloadInstrument method when the instrument is no longer needed.
Header: Declared in dmusici.h.