i found there are several posts here about unloading a dll using ctypes, and i followed exactly the way said to be working
from ctypes import *
file = CDLL('file.dll')
# do some stuff here
handle = file._handle # obtain the DLL handle
windll.kernel32.FreeLibrary(handle)
however, i am on python 64 bit and my dll is also compiled for x64, and i got an error from the last line above saying:
argument 1: <class 'OverflowError'>: int too long to convert
and i checked the handle to be a long int (int64) of '8791681138688', so does that mean windll.kernel32 only deals with int32 handle? Google search shows kernal32 is also for 64bit windows. how should i deal with this then?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…