应用程序错误。应用程序无法正确启动(0x000007b)。单击“确定”关闭应用程序

时间:2016-08-25 08:21:07

标签: windows dllimport

有人可以帮助解决以下错误吗?

'WidgetKeyboard.exe': Loaded 'C:\Windows\SysWOW64\wsock32.dll', Cannot find or open the PDB file
'WidgetKeyboard.exe': Loaded 'C:\Windows\SysWOW64\ws2_32.dll', Cannot find or open the PDB file
'WidgetKeyboard.exe': Loaded 'C:\Windows\SysWOW64\msvcrt.dll', Cannot find or open the PDB file
'WidgetKeyboard.exe': Loaded 'C:\Windows\SysWOW64\rpcrt4.dll', Cannot find or open the PDB file
'WidgetKeyboard.exe': Loaded 'C:\Windows\SysWOW64\sspicli.dll', Cannot find or open the PDB file
'WidgetKeyboard.exe': Loaded 'C:\Windows\SysWOW64\cryptbase.dll', Cannot find or open the PDB file
'WidgetKeyboard.exe': Loaded 'C:\Windows\SysWOW64\sechost.dll', Cannot find or open the PDB file
'WidgetKeyboard.exe': Loaded 'C:\Windows\SysWOW64\nsi.dll', Cannot find or open the PDB file
'WidgetKeyboard.exe': Loaded 'C:\Suneel\Keyboard\WidgetKeyboard\Debug glsdll md\iconv.dll', Binary was not built with debug information.
'WidgetKeyboard.exe': Loaded 'C:\Suneel\Keyboard\WidgetKeyboard\Debug glsdll md\zlib1.dll', Binary was not built with debug information.
The program '[6452] WidgetKeyboard.exe: Native' has exited with code -1073741701 (0xc000007b).

2 个答案:

答案 0 :(得分:1)

你不能给我们太多的开始。显然你在.NET中使用DllImport(我猜错了,如果我错了,请纠正我。)

0xc000007b表示STATUS_INVALID_IMAGE_FORMAT,您可能正在尝试将32位图像加载到64进程中,反之亦然。

通常,Windows会尝试阻止这种情况发生。文件系统虚拟化确保将来自C:\ Windows \ system32的DLL加载重定向到C:\ Windows \ syswow64,并且注册表虚拟化确保COM服务器与COM客户端的位相匹配。

你可能做的就是绕过这些反制措施。也许您将DLL复制到与EXE相同的文件夹中。或者DLL路径的分辨率出错,例如因为您依赖于系统的PATH环境变量,或者您使用了SetDllDirectory()

首先,检查应用程序的位数是否与要导入的DLL的位数相匹配。如果失败,请使用SysInternals' ProcMon,显示它正在尝试加载的文件。

答案 1 :(得分:0)

这是一个NTSTATUS错误代码。在这里查找:https://msdn.microsoft.com/en-gb/library/cc704588.aspx

在您的情况下,0xC000007BSTATUS_INVALID_IMAGE_FORMAT。这样描述:

  

{Bad Image}%hs要么不是设计为在Windows上运行,要么包含错误。尝试使用原始安装介质再次安装程序,或与系统管理员或软件供应商联系以获取支持。

通常,这意味着加载程序在解析加载时依赖性时,正在尝试将64位DLL加载到32位进程中,反之亦然。您显示的诊断程序表明您的进程是32位进程。所以你应该寻找加载器试图加载的64位DLL。在配置文件模式下使用Dependency Walker工具进行调试。

相关问题