Unhandled exception in text.exe (KERNELBASE.DLL): 0xE06D7363: Microsoft C++ Exc

u012881680 2015-10-20 02:59:47
win7下运行一个VC6.0 基于单文档的绘图程序时一段时间后窗口自动关闭,调试状态运行一段时间提示信息为:
Unhandled exception in text.exe (KERNELBASE.DLL): 0xE06D7363: Microsoft C++ Exception.
...全文
362 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
赵4老师 2015-10-21
  • 打赏
  • 举报
回复
GetDC The GetDC function retrieves a handle to a display device context for the client area of a specified window or for the entire screen. You can use the returned handle in subsequent GDI functions to draw in the device context. The GetDCEx function is an extension to GetDC, which gives an application more control over how and whether clipping occurs in the client area. HDC GetDC( HWND hWnd // handle to a window ); Parameters hWnd Handle to the window whose device context is to be retrieved. If this value is NULL, GetDC retrieves the device context for the entire screen. Windows 98, Windows NT 5.0 and later: If this parameter is NULL, GetDC retrieves the device context for the primary display monitor. To get the device context for other display monitors, use the EnumDisplayMonitors and CreateDC functions. Return Values If the function succeeds, the return value identifies the device context for the specified window's client area. If the function fails, the return value is NULL. Windows NT: To get extended error information, callGetLastError. Remarks The GetDC function retrieves a common, class, or private device context depending on the class style specified for the specified window. For common device contexts, GetDC assigns default attributes to the device context each time it is retrieved. For class and private device contexts, GetDC leaves the previously assigned attributes unchanged. After painting with a common device context, the ReleaseDC function must be called to release the device context. Class and private device contexts do not have to be released. The number of device contexts is limited only by available memory. QuickInfo Windows NT: Requires version 3.1 or later. Windows: Requires Windows 95 or later. Windows CE: Requires version 1.0 or later. Header: Declared in winuser.h. Import Library: Use user32.lib. See Also Device Contexts Overview, Device Context Functions, GetDCEx, ReleaseDC, GetWindowDC
u012881680 2015-10-21
  • 打赏
  • 举报
回复
我调试跟踪后发现,程序运行一段时间会跳出错误,是在CDC*pDC = GetDC();这个定义的指针为空。不知道怎么回事,请大家多多指教。
赵4老师 2015-10-20
  • 打赏
  • 举报
回复
崩溃的时候在弹出的对话框按相应按钮进入调试,按Alt+7键查看Call Stack即“调用堆栈”里面从上到下列出的对应从里层到外层的函数调用历史。双击某一行可将光标定位到此次调用的源代码或汇编指令处,看不懂时双击下一行,直到能看懂为止。 检查是否资源泄漏的办法之一: 在任务管理器 进程 查看 选择列 里面选择:内存使用、虚拟内存大小、句柄数、线程数、USER对象、GDI对象 让你的程序(进程)不退出,循环执行主流程很多遍,越多越好,比如1000000次甚至无限循环,记录以上各数值,再隔至少一小时,越长越好,比如一个月,再记录以上各数值。如果以上两组数值的差较大或随时间流逝不断增加,则铁定有对应资源的资源泄漏! 搜“GDI泄露检测”

16,467

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • Web++
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧