3

我正在尝试使用 ctypes 调用 dll 函数并出现错误。如何获得有关我的电话有什么问题的更多信息?

dll函数头:

DLL_API BOOL WINAPI DDSSetFrequency(int index, double frequency, int* wavePointNum, int* TNum); 

蟒蛇代码

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
4

1 回答 1

0

你可能还没有在这个项目上工作,但如果你是(为了后代的缘故),我提供了一个指向我为 HT1025G 编写的 python 包装器的链接,它演示了一个工作界面。set_frequency方法有点挑剔,我发现(未记录的)set_divisor方法更好。

于 2015-04-26T18:29:30.597 回答