I'm working for the first time with ctypes to import DLLs. The DLL which I've imported contains a function which return a DWORD value. How can I convert this DWORD value?
for other functions which takes WORD arguments values I tried something like this (found in stack overflow).
from ctypes import *
my_dll = ctypes.windll.LoadLibrary (r"C:\\Users\\Mimouni\\Documents\\FFT_python\\Sense2020Dll.dll")
py_DLL_Acquire_Spectrum = my_dll.DLL_Acquire_Spectrum
py_DLL_Acquire_Spectrum.argtypes = [POINTER(c_double),POINTER(c_double),POINTER(c_double)]
py_DLL_Acquire_Spectrum.restype = None
pdblWavelength = (c_double)(my_dll.DLL_Get_Pixel_Count())
pdblPower = (c_double)(my_dll.DLL_Get_Pixel_Count())
pdblTemperature = (c_double)(0)
py_DLL_Acquire_Spectrum(pdblWavelength,pdblPower,pdblTemperature)
How can I use wintypes for returned values?
Thank you in advance.
If you have a variable
xof typeDWORD(which is just an alias forctypes.c_ulong), you can just usea.valueto get itsintvalue.