we´ve got a problem with receiving sysex-messages. to receive a sysex message you have to call the method “midiInAddBuffer” to provice a buffer where the sysex-data can be stored in. you have to call it for every package of the message.
this works great so far - but the problem is if i close the Indevice now and try to open it again it crashes.
if i call “midiInAddBuffer” only once at the beginning, i can reveive only the first package for sure, but now i can close and open the device without any problems.
I do not have the source code here, so I will try to explain what I do in the code.
I open a midi device with the midiInOpen function. I also defined a callback function, where I can receive the messages.
After opening the device I start the receiving with midiInStart and add a buffer with midiInAddBuffer.
Before adding the buffer I prepare it with midiInPrepareHeader. It all works fine. Now I can receive SysEx messages (and other midi messages).
But only the first block. To receive more than one block I make another call of midiInAddBuffer in the callback function (after I received a block). Now I can receive all the other blocks, too.
But the device doesn’t close (midiInClose) right now and I cannot open it anymore. Do I have to do something else, before calling the second time midiInAddBuffer.