【发布时间】:2014-05-07 15:29:37
【问题描述】:
我发现这里有几篇关于使用 ctypes 卸载 dll 的帖子,我完全按照所说的工作方式进行操作 从 ctypes 导入 *
file = CDLL('file.dll')
# do some stuff here
handle = file._handle # obtain the DLL handle
windll.kernel32.FreeLibrary(handle)
但是,我在 python 64 位上,我的 dll 也是为 x64 编译的,我从上面的最后一行得到一个错误:
argument 1: <class 'OverflowError'>: int too long to convert
并且我检查了句柄是'8791681138688'的长整数(int64),那么这是否意味着windll.kernel32只处理int32句柄?谷歌搜索显示 kernal32 也适用于 64 位窗口。那我该怎么处理呢?
【问题讨论】: