开发者社区> 问答> 正文

python调用C写的dll?报错

@Honghe 你好,想跟你请教个问题:windows平台上,Python调用C写的dll,dll采用cdecl,在调用AR_GetCount()函数时可以正确返回,调用AR_OpenByID()时,报错valueError:procedure called with enough arguments <4 bytes missing> or wrong calling convention.代码如下:

from ctypes import cdll

print ('starting...')
dll=cdll.LoadLibrary('./AmUfdHlp.dll')
count=dll.AR_GetCount()
print (count)
byid=dll.AR_OpenByID(0)
print ('Open succeed!')

看到请回复啊,谢谢喽

展开
收起
爱吃鱼的程序员 2020-06-14 17:35:00 771 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    <spanstyle="font-size:13.3333330154419px;">没有<spanstyle="font-size:13.3333330154419px;">AmUfdHlp源码,估计<spanstyle="font-size:13.3333330154419px;"><spanstyle="font-size:13.3333330154419px;">可能是调用参数与<spanstyle="font-size:13.3333330154419px;">AmUfdHlp.dll接受参数不一致。<spanstyle="font-size:13.3333330154419px;">值为0参数就一个int数值

    2020-06-14 17:35:17
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
From Python Scikit-Learn to Sc 立即下载
Data Pre-Processing in Python: 立即下载
双剑合璧-Python和大数据计算平台的结合 立即下载