midiOutLongMsg

Syntax

WORD midiOutLongMsg(hMidiOut, lpMidiOutHdr, wSize)

This function sends a long MIDI message to the specified MIDI output device. Use this function to send system exclusive messages or to send a buffer filled with short messages.

Parameters

HMIDIOUT hMidiOut

Specifies a handle to the MIDI output device.

LPMIDIHDR lpMidiOutHdr

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

WORD 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:

MMSYSERR_INVALHANDLE

Specified device handle is invalid.

MIDIERR_UNPREPARED

lpMidiOutHdr hasn't been prepared.

MIDIERR_NOTREADY

The hardware is busy with other data.

Comments

The data buffer must be prepared with midiOutPrepareHeader before it is passed to midiOutLongMsg. 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. This function may or may not return until the data block has been sent to the output device.

See Also

midiOutShortMsg, midiOutPrepareHeader