Bad DLL Calling Convention
Some customers have experienced problems when calling the nt6400.dll functions in VB5.0 under the NT4.0 operating system. One customers functions were declared correctly in his AT6400.BAS file but he was getting the following error:
Run time error 49
Bad DLL calling convention.
It turned out that he had declared our NT DLL function as follows:
Declare Function SendAT6400Block% Lib "nt6400.dll" (ByVal ADDRESS%, ByVal cmd$, ByVal irqnum%)
The problem was that he had a copy of nt6400.dll in his current project directory. He also had this file in the system directory. The problem was resolved when he took the nt6400.dll out from his project directory and placed in the operating system directory.