Debug .exe中的运行时错误 [英] Runtime errors in Debug .exe

查看:116
本文介绍了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中的运行时错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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