【发布时间】:2011-07-13 03:38:41
【问题描述】:
在我开始使用我需要的更重要的 dll 之前,我用 C++ 编写了一个测试 dll 以确保一切正常。基本上它需要两个双打并将它们相加,然后返回结果。我一直在玩弄其他测试功能,我已经恢复工作,但由于错误,我无法传递参数。 我的代码是:
import ctypes
import string
nDLL = ctypes.WinDLL('test.dll')
func = nDLL['haloshg_add']
func.restype = ctypes.c_double
func.argtypes = (ctypes.c_double,ctypes.c_double)
print(func(5.0,5.0))
它返回调用“func”的行的错误:
ValueError: Procedure probably called with too many arguments (8 bytes in excess)
我做错了什么?谢谢。
【问题讨论】: