The midiInPrepareHeader function prepares a buffer for MIDI input.
MMRESULT midiInPrepareHeader(
HMIDIIN hMidiIn,
LPMIDIHDR lpMidiInHdr,
UINT cbMidiInHdr
);
Returns MMSYSERR_NOERROR if successful or an error otherwise. Possible error values include the following:
Value | Description | ||
---|---|---|---|
MMSYSERR_INVALHANDLE | The specified device handle is invalid. | ||
MMSYSERR_INVALPARAM | The specified address is invalid. | ||
MMSYSERR_NOMEM | The system is unable to allocate or lock memory. |
Preparing a header that has already been prepared has no effect, and the function returns zero.
After the header has been prepared, do not modify the buffer. To free the buffer, use the midiInUnprepareHeader function.
Before using this function, you must set the lpData, dwBufferLength, and dwFlags members of the MIDIHDR structure. The dwFlags member must be set to zero.
Windows NT: Requires version 3.1 or later.
Windows: Requires Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in mmsystem.h.
Import Library: Use winmm.lib.
Musical Instrument Digital Interface (MIDI) Overview, MIDI Functions, MIDIHDR, midiInUnprepareHeader