I have a VB6 callback function, which the system calls when MIDI messages arrive. It works in the development environment, but when I make a .exe, it crashes when I try to modify the form. I presume this is illegal, and I somehow need to get the information from the callback function back to a form procedure. What is the best way to do this?
Details:
At form_load time, I open a MIDI input stream like this:
Expand|Select|Wrap|Line Numbers
- ret = midiInOpen(midiInHnd, midiInDev, AddressOf MidiInProc, 0, CALLBACK_FUNCTION)
Expand|Select|Wrap|Line Numbers
- MidiMon.lblMsgCounts(stat) = Str(MessageCounts(stat))
Expand|Select|Wrap|Line Numbers
- Unhandled exception in MidiM.exe (OLEAUT32.DLL): 0C0000005: Access Violation
Expand|Select|Wrap|Line Numbers
- PostMessage(NULL, WM_USER, dwParam1, dwParam2)
- GetMessage(msg, NULL, WM_USER, WM_USER)