
Bad Calling Convention error 49 - due to calling a Sub in a .bas module
Let's call the Sub Xyz (doesn't matter what here). Ignoring the minor
details, it dimensions a UDT variable based on a Type...End Type,
which is in the .bas module. This was initially Type without Public in
front.
The Sub in question calls midiOutPrepareHeader, midiOutLongMsg and
midiOutUnprepareHeader.
In my form I have a menu command to send a MIDI GS Reset message. This
calls Xyz and passes the appropriate string of bytes.
****************************************************************
The error 49 occurs if Sub Xyz is in the .bas module!
****************************************************************
If I move Xyz to the form it's being called from, the error goes away.
Why? I've called ump{*filter*} Subs/Functions in .bas modules from forms
before. <puzzled look>
Debugging attempts: While Sub Xyz was still in the .bas module I tried
sticking Public in front of it. Made no difference. Error still
occurred. Then I tried sticking Public in front of the Type...End
Type. Also made no difference.
MM