python调用dll报错:ValueError: Procedure called with not enough arguments (4 bytes missing) or wrong call

python调用dll报错:ValueError: Procedure called with not enough arguments (4 bytes missing) or wrong calling convention

调用代码如下:

import ctypes
dll = ctypes.cdll.LoadLibrary("FingerVein_v3_dev.dll")
open = dll.fvdev_open
print('open:',open)

报错:

Traceback (most recent call last):
  File "C:/Users/xiahuadong/Desktop/代码/芯灵科技指静脉算法/X2-USB-SDK/python_from_c++.py", line 7, in <module>
    setno = dll.fvdev_setno(0)
ValueError: Procedure called with not enough arguments (4 bytes missing) or wrong calling convention

解决方法:把cdll换成windll

代码:

import ctypes
dll = ctypes.windll.LoadLibrary("FingerVein_v3_dev.dll")
open = dll.fvdev_open
setno = dll.fvdev_setno(0)
print('open:',open)

成功

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-ySbRA6ii-1574407074620)(C:\Users\xiahuadong\Pictures\博客\124.png)]

发布了132 篇原创文章 · 获赞 30 · 访问量 5万+

猜你喜欢

转载自blog.csdn.net/weixin_44493841/article/details/103201380
今日推荐