我试图使用ctype调用一个dll函数,但得到了一个错误。如何获取有关我的呼叫问题的更多信息?
dll函数头:
DLL_API BOOL WINAPI DDSSetFrequency(int index, double frequency, int* wavePointNum, int* TNum); python代码
from ctypes import *
hantek = cdll.LoadLibrary("E:\Programmer's Guide\DLL\DDS3X25Dll.dll")
print hantek.DDSSearch()
wavePointNum = c_int()
Tnum = c_int()
frequency = c_double(10000000.0)
index = c_int32(1)
hantek.DDSSetFrequency(index,frequency,byref(wavePointNum),byref(Tnum))
1
Traceback (most recent call last):
File "3x25.py", line 17, in <module>
hantek.DDSSetFrequency(index,frequency,byref(wavePointNum),byref(Tnum))
ValueError: Procedure called with not enough arguments (20 bytes missing) or wro
ng calling convention发布于 2015-04-27 02:29:31
您可能还没有在这个项目上工作,但如果您还在工作(为了后人着想),我提供了一个我为HT1025G编写的link to a python wrapper,它演示了一个有效的接口。set_frequency方法有点吹毛求疵,我发现(没有文档记录的) set_divisor方法更好用。
https://stackoverflow.com/questions/13822387
复制相似问题