Bad Calling Convention error 49 - due to calling a Sub in a .bas module 
Author Message
 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



Fri, 07 Sep 2012 20:54:42 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Run-time error '49': Bad DLL calling convention

2. Bad DLL calling convention (error 49)

3. Error 49: Bad Dll Calling convention

4. Help Re: error 49 Bad DLL calling convention

5. Error 49 -- Bad DLL Calling Convention

6. error 49 - bad dll calling convention

7. Possible answer to Err 49: Bad DLL calling convention

8. Possible answer to Err 49: Bad DLL calling convention

9. RunTime 49: Bad DLL Calling Convention

10. Access200 - Error 49: "Bad DLL calling..."

11. error 49 - Bad DLL callling convention

12. Bad DLL calling covention '49'

 

 
Powered by phpBB® Forum Software