Debug .exe中的运行时错误

编程入门 行业动态 更新时间:2024-10-19 15:29:31
本文介绍了Debug .exe中的运行时错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在发布模式下,我的程序运行正常,没有重大问题! 我遇到了一些运行时错误,这些错误只发生在Debug配置中。该程序在调试模式下编译良好。 我看到一个消息框 - > 调试断言失败! 程序:< program name => 文件:winocc.cpp 行:330 顺序调试,带我到这在doctempl.cpp

//从资源创建新的if(!pFrame-> LoadFrame(m_nIDResource,$ b $) b WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE,//默认框架样式 NULL,& context)) { TRACE(traceAppMsg,0,警告:CDocTemplate无法创建框架。 N); //框架将在PostNcDestroy中删除清理返回NULL; }

这是断言弹出的地方。 在链接器中,这些是我依赖的附加库。这里有什么不对吗? d3d9.lib strmiids.lib ole32.lib winmm.lib psapi.lib user32.lib 知道我做错了什么吗? 谢谢。

解决方案

转到引发ASSERT的代码行。这可能是 BOOL CWnd :: ShowWindow(int nCmdShow)函数。设置断点(F9)并运行程序(debug)。在第一次点击或其他一些操作时,窗口句柄可能无效。检查调用堆栈并避免使用无效的窗口句柄调用 ShowWindow 。 问候。

删除所有临时文件并构建文件并进行全部重建。有时是资源ID冲突的问题。 或者你必须调试MFC-stuff:mad:

也许问题可能在ID.maybe中。

In the Release mode, my program runs fine, no major problems! I am getting some runtime errors which are only occuring in the "Debug" configuration. The program compiles fine in Debug mode. I see a message box -> Debug Assertion Failed! Program: <program name=""> File: winocc.cpp Line: 330 Sequentially debugging, led me to this in doctempl.cpp

// create new from resource if (!pFrame->LoadFrame(m_nIDResource, WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE, // default frame styles NULL, &context)) { TRACE(traceAppMsg, 0, "Warning: CDocTemplate couldn''t create a frame.\n"); // frame will be deleted in PostNcDestroy cleanup return NULL; }

This is where the assertion pops up. In the linker, these are my additional library dependies. Is something wrong here? d3d9.lib strmiids.lib ole32.lib winmm.lib psapi.lib user32.lib Any idea what I am doing wrong? Thanks.

解决方案

Goto the code line where the ASSERT is raised. this maybe the BOOL CWnd::ShowWindow(int nCmdShow) function. Set a break point (F9) and run the program (debug). At the first hit or some else the window handle may be invalid. Check the call stack and avoid the call of ShowWindow with an invalid window handle. Regards.

delete all temp and build files and make a "rebuild all". Sometimes is an resource ID conflict the problem. Or you must debug in the MFC-stuff :mad:

Maybe problem In ID.maybe maybe.

更多推荐

Debug .exe中的运行时错误

本文发布于:2023-11-05 08:13:18,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1560324.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:错误   Debug   exe

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!