调用非托管 DLL 时 vshost32.exe 崩溃 [英] vshost32.exe crash when calling unmanaged DLL

查看:21
本文介绍了调用非托管 DLL 时 vshost32.exe 崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 VS 2005 应用程序与非托管 (Fortran) DLL 进行交互.当我直接从命令行运行编译后的可执行文件时,一切正常 - 可以访问 DLL,并且我可以使用 DLL 中的函数.

I'm using a VS 2005 app to interface against an unmanaged (Fortran) DLL. When I run the compiled executable straight from the command line, everything is fine - the DLL can be accessed, and I can work with the functions in the DLL.

不幸的是,当我从 VS 2005 启动应用程序时,我收到一个弹出窗口,指出vshost32.exe 已停止工作"并且没有有用的调试信息.

Unfortunately, when I launch the app from VS 2005, I get a popup stating "vshost32.exe has stopped working" and no useful debugging information.

有没有人遇到过这种行为,或者知道为什么会发生这种情况?我不明白为什么它在独立启动时可以正常运行,但不能通过 vshost32 运行.

Has anyone experienced this behavior, or know why this might be occuring? I can't figure out why it would run fine when launched stand-alone, but not via vshost32.

(最后一个注意事项:我正在使用 .local 文件强制从 cwd 使用注册的 dll,但是这个特定的 dll 没有注册.我只是在这里注明,以防万一.)

(One last note: I am using .local files to force registered dlls to be used from cwd, but this particular dll is not registered. I'm just noting it here in case it helps.)

非常感谢,

迈克

推荐答案

我遇到了 vshost32.exe 崩溃的问题,当我选中复选框时,问题消失了:

I had problem with crashes of vshost32.exe the problem vanished when I checked the checkbox:

属性 ->调试 ->启用非托管代码调试

它对你有用吗?

在最近的版本中,该选项被称为:启用本机代码调试(感谢 Qwerty01)

In more recent versions the option is called: Enable native code debugging (thanks Qwerty01)

它似乎对 VS2008 (@Deacon Frost)、VS2010 (@Alxandr) 也有帮助.

It also seems to help in VS2008 (@Deacon Frost), VS2010 (@Alxandr).

这篇关于调用非托管 DLL 时 vshost32.exe 崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆