简体   繁体   English

在 Python 中加载 dll 时出现 Windows 错误 1114

[英]Windows Error 1114 while loading dll in Python

I am currently trying to port some code from a 32 bit windows XP computer to a 64 bit windows 10 computer.我目前正在尝试将一些代码从 32 位 Windows XP 计算机移植到 64 位 Windows 10 计算机。 I need in my python code to import home developed C dlls as follow :我需要在我的 python 代码中导入家庭开发的 C dll,如下所示:

    from ctypes import *
    [...]
    self.inter_test_dll = windll.LoadLibrary("my.dll")

    self.w = QtWidgets.QWidget()
    self.wid = self.w.winId()
    self.wid.setsize(64)
    print(self.wid)
    self.inter_test_dll.dll_load_window(int(self.wid), 'test')
    self.inter_test_dll.dll_connect(2, self.callback)
    [...]

The program crashes as soon as the dll is loaded with a cryptic一旦 dll 加载了一个神秘的程序,程序就会崩溃

    Windows Error 1114

Which means a dll crashed on initialization.这意味着 dll 在初始化时崩溃了。 I have tried my dll on my personal machine (64 bits Windows 7), no issue, it all works fine.我已经在我的个人机器(64 位 Windows 7)上尝试过我的 dll,没问题,一切正常。 I have tried that dll on the same 64 bits Windows 10 machine from within a C program, LoadLibrary("my.dll") also fails but LoadLibraryEx("my.dll",NULL, DONT_RESOLVE_DLL_REFERENCE ) does work.我已经在 C 程序中的同一台 64 位 Windows 10 机器上尝试了该 dll,LoadLibrary("my.dll") 也失败了,但 LoadLibraryEx("my.dll",NULL, DONT_RESOLVE_DLL_REFERENCE) 确实有效。

When I run a dependency walker on my dll, it seems to miss some 2 to 4 depth level dll, but it weirdly doesn't seem to affect its working when called properly from within the C program.当我在我的 dll 上运行依赖项walker时,它似乎错过了一些 2 到 4 个深度级别的 dll,但奇怪的是,当从 C 程序中正确调用时,它似乎并没有影响它的工作。

So my question is, is there a way to instantiate my dll within Python without an in-depth check of its dependencies ?所以我的问题是,有没有办法在 Python 中实例化我的 dll 而无需深入检查其依赖项? If not, is there a way to modify my windows behavior, in order to skip that check by default ?如果没有,有没有办法修改我的 Windows 行为,以便默认跳过该检查?

Thanks a lot !非常感谢 !

Thanks for the comments, I have resolved my issue.感谢您的评论,我已经解决了我的问题。

WxWidgets has been updated 2 days ago. WxWidgets 已于 2 天前更新。 I have recompiled my dll with this new version and the bug is gone.我已经用这个新版本重新编译了我的 dll 并且错误消失了。

Sorry I couldn't find a more general approach to the problem.抱歉,我找不到更通用的方法来解决这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 LoadLibraryA 方法在超过 1000 次加载/卸载循环后返回错误代码 1114 (ERROR_DLL_INIT_FAILED) - The LoadLibraryA method returns error code 1114 (ERROR_DLL_INIT_FAILED) after more than 1000 cycles of loading/unloading 在Windows 7嵌入式上运行一个简单的python应用程序会出现“未找到入口点错误”和“加载dll时出错” - Running a simple python app on Windows 7 embedded gives an “Entry point not found error” and an “Error loading dll” 在Windows Python 3.4中加载.dll文件 - Loading a .dll file in Windows Python 3.4 在 python 3.8 和 tensorflow 2.5.0 使用 python 加载 cudart64_110.dll 时出错 - Error loading cudart64_110.dll with python 3.8 and tensorflow 2.5.0 using conda on Windows 如何修复此dll加载python错误? - How to fix this dll loading python error? Pyinstaller - 加载错误 Python DLL - FormatMessageW 失败 - Pyinstaller - Error loading Python DLL - FormatMessageW failed 部署 Tkinter:加载 Python dll/LoadLibrary 时出错 - Deploy Tkinter : error loading Python dll/ LoadLibrary Pyinstaller 创建 exe 后在 Windows 7 上加载 python37 dll 时出错 - Error loading python37 dll on Windows 7 after Pyinstaller created exe 加载python27.dll(pyinstaller)时出错 - error loading python27.dll (pyinstaller) 加载python26.dll时出错(14003) - Error loading python26.dll (14003)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM