MMRESULT midiInOpen(
LPHMIDIIN lphMidiIn,
UINT_PTR uDeviceID,
DWORD_PTR dwCallback,
DWORD_PTR dwCallbackInstance,
DWORD dwFlags
);
Значит уже что-то возвращает...
Value Description
MMSYSERR_ALLOCATED The specified resource is already allocated.
MMSYSERR_BADDEVICEID The specified device identifier is out of range.
MMSYSERR_INVALFLAG The flags specified by dwFlags are invalid.
MMSYSERR_INVALPARAM The specified pointer or structure is invalid.
MMSYSERR_NOMEM The system is unable to allocate or lock memory.
Читаем там же...
Что бы я проверил первым делом? Если вообще девайсы такого типа в системе!
Querying MIDI DevicesBefore playing or recording MIDI data, you must determine the capabilities of the MIDI hardware present in the system. MIDI capability can vary from one multimedia computer to the next; applications should not make assumptions about the hardware present in a given system.
midiInGetNumDevsReturns the number of MIDI input devices present in the system. A return value of zero means that there are no devices (not that there is no error).
Читаем далее...
Like other audio devices, MIDI devices are identified by a device identifier, which is determined implicitly from the number of devices present in a given system. Device identifiers range from zero to the number of devices present, minus one. For example, if there are two MIDI output devices in a system, valid device identifiers are 0 and 1.
Ну и далее уже знакомый midiInOpen.