Arguments passed to a dynamic-link library (DLL) or Macintosh code resource routine must exactly match those expected by the routine. Calling conventions deal with number, type, and order of arguments. This error has the following causes and solutions: Your program is calling a routine in a DLL (in Windows) or a code resource (on the Macintosh) that's being passed the wrong type of arguments.
Make sure all argument types agree with those specified in the declaration of the routine you are calling.
Your program is calling a routine in a DLL (in Windows) or a code resource (on the Macintosh) that's being passed the wrong number of arguments.Make sure you are passing the same number of arguments indicated in the declaration of the routine you are calling.
Your program is calling a routine in a DLL, but isn't using the StdCall calling convention.If the DLL routine expects arguments by value, then make sure ByVal is specified for those arguments in the declaration for the routine.
Your Declare statement for a Windows DLL includes CDecl.The CDecl keyword applies only to the Macintosh.
For additional information, select the item in question and press F1 (in Windows) or HELP (on the Macintosh).
我明明是用了__stdcall,为什么还会有错误呢?再说了,相同的代码在vb中也是可以被正常执行的.难道说Testpartner中的vb为非标准的vb?于是,我就想试一下其他的window api是否能够被正常调用。copy了个sleep的声明 Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) Private Declare Function HelloWorld Lib "Test.dll" () 突然发现了一个与自己声明不一致的地方,那就是我用了Function来声明这个没有返回值得函数。在vb中,没有返回值得函数应该用sub. 于是改了一下,错误也就不在了。 看来,Testpartner的vb环境比标准vb IDE在语法上要求更严格!文章来源于领测软件测试网 https://www.ltesting.net/