我正在尝试使用ctypes调用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
答案 0 :(得分:0)
你可能还没有在这个项目上工作,但如果你是(为了后人的缘故),我正在为HT1025G提供link to a python wrapper我写的演示工作界面。 set_frequency
方法有点笨拙,我发现(未记录的)set_divisor
方法运气更好。