我在 python 中使用 DLL 函数时遇到问题。我通过“dumpbin”查看了函数的名称。
例如
_xGraphics3D@20
我试图这样调用函数:
from ctypes import *
xorsLib = cdll.LoadLibrary("Xors3D.dll")
width = c_int(800)
height = c_int(600)
depth = c_int(32)
mode = c_int(0)
vsync = c_int(0)
xGraphics3D = getattr(xorsLib,"_xGraphics3D@20")
xGraphics3D(width, height, depth, mode, vsync)
但这会导致错误:
Traceback (most recent call last):
File "D:/Coding/Python/pyASG/main", line 11, in <module>
xGraphics3D(width, height, depth, mode, vsync)
ValueError: Procedure called with not enough arguments (20 bytes missing) or wrong calling convention
我究竟做错了什么?
ps我不知道python,但我学过。我阅读了 ctype-manual 并试图找到答案...
pps 对不起我糟糕的英语。