If you want to call a function with a name GetRate, you can do it like:
from ctypes import *
from ctypes.wintypes import *
GetRate = windll.YOURLIB.GetRate
GetRate.restype = c_int
GetRate.argtypes = [HANDLE, POINTER(c_int)]
but if you try to declare a callback, a pointer to a function, you can do it like (I think you're looking for the first one):
from ctypes import *
from ctypes.wintypes import *
def GetRate(hDev, pDate):
return 0
GETRATE = WINFUNCTYPE(c_int, HANDLE, POINTER(c_int))
pGetRate = GETRATE(GetRate)
user1129665
source
share