_CRT_DEBUGGER_HOOK 抛出异常
我在将程序从 VS2005 转换为 VS2008 时遇到问题。 当我跑步时 VS2008中的程序,应用程序启动正常,但是当开始播放时 应用程序崩溃并给出以下错误:
“Microsoft Visual Studio C 运行时库已检测到致命错误”
然后调试器将我指向此功能:
__declspec(noinline)
void __cdecl _CRT_DEBUGGER_HOOK(int _Reserved)
{
/* assign 0 to _debugger_hook_dummy so that the function is not folded
in retail */
(_Reserved);
_debugger_hook_dummy = 0;
}
编译应用程序 ase 版本工作正常...
顺便说一下,这是调用包装 .NET 代码的托管 C++ 代码的本机代码。
我该如何调试这种情况?
奥弗
I'm having a problem converting my program from VS2005 to VS2008. When I run
the program in VS2008, the application starts up fine but when start playing
around with the application it crashes giving me this error:
"Microsoft Visual Studio C Runtime Library has detected a fatal error"
And then the debugger points me to this function:
__declspec(noinline)
void __cdecl _CRT_DEBUGGER_HOOK(int _Reserved)
{
/* assign 0 to _debugger_hook_dummy so that the function is not folded
in retail */
(_Reserved);
_debugger_hook_dummy = 0;
}
compiling the application ase release works prefectly...
By the way, this is a native code calling a managed c++ code that wrapps .NET code.
How can I debug such situation ?
Ofer
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
确保所有依赖项也使用 VS2008 调试进行编译。
当我在 VS2008-debug 中编译程序以及在 VS2003 中编译一些依赖的 DLL 时,以及在 VS2008-debug 中编译程序以及编译为发布版本的一些依赖项时,我也遇到了同样的问题。
Make sure all of your dependencies are also compiled with VS2008 debug.
I experienced this same issue when compiling a program in VS2008-debug, and some of the dependent DLLs where compiled in VS2003, and also when compiling a program in VS2008-debug and some of the dependencies where compiled as release.