大家好,我有一个dll文件需要加载并使用
dll的对外接口是testDLL(char *aa,char *bb)
参数aa要求16个字节,其中bb是输出参数,也是16个字节,testDLL函数也有返回值,返回数字0到10。
我用VB6调用这个dll,一切正常,输出的值也全在意料之中。
但是老板非要用python,可我从没用过python,在网上查了一些资料,但是我用python写的就怎么也不行,几近崩溃啊。我用的是py2.7。
请大家帮帮忙,错误到底出在哪里,着急啊
以下是我的py代码:
from ctypes import *
test = CDLL('testDLL.dll')
test.testDLL.argtypes = [POINTER(c_char), POINTER(c_char)]
aa = '1234567890123456'
bb = '1234567890123456'
test.testDLL(aa, bb)
下面是运行后的报错信
Traceback (most recent call last):
File "C:/Users/Administrator/Desktop/abc/test.py", line 20, in <module>
print test.testDLL(aa, bb)
ValueError: Procedure called with not enough arguments (8 bytes missing) or wrong calling convention
Process finished with exit code -1073741819