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在語法上要求更嚴格!原文轉自:http://www.anti-gravitydesign.com