midiInAddBuffer

  MMRESULT midiInAddBuffer(hMidiIn, lpMidiInHdr, wSize)    
  HMIDIIN hMidiIn;    
  LPMIDIHDR lpMidiInHdr;    
  UINT wSize;    

The midiInAddBuffer function sends an input buffer to a specified opened MIDI input device. When the buffer is filled,it is sent back to the application. Input buffers are used only for system-exclusive messages.

Parameters

hMidiIn

Specifies a handle to the MIDI input device.

lpMidiInHdr

Specifies a far pointer to a MIDIHDR structure that identifies the buffer.

wSize

Specifies the size of the MIDIHDR structure.

Return Value

Returns zero if the function was successful. Otherwise, it returns an error number. Possible error returns are:

Value Meaning

MMSYSERR_INVALHANDLE Specified device handle is invalid.
MIDIERR_UNPREPARED lpMidiInHdr hasn't been prepared.

Comments

The data buffer must be prepared with midiInPrepareHeader before it is passed to midiInAddBuffer. The MIDIHDR data structure and the data buffer pointed to by its lpData field must be allocated with GlobalAlloc using the GMEM_MOVEABLE and GMEM_SHARE flags, and locked with GlobalLock.

See Also

midiInPrepareHeader