当失去对MFC的关注时,应用程序崩溃 [英] Application get Crash when lose focus in mfc

查看:276
本文介绍了当失去对MFC的关注时,应用程序崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好
我在
遇到了一些问题

Hello everyone
I am facing some problem in

CallWindowProc(oldWndProc, hWnd, nMsg, wParam, lParam)


其中nMsg = 28
我没有得到该消息的哪种类型n每当应用程序失去焦点时为什么会出现此消息.
提前感谢..祝大家圣诞节快乐...


where nMsg = 28
i didnt get which type of this message n why it occures whenever application lose focus..
Thanx in advance.. n mery X''mas n happy new year...

推荐答案

当您的程序尝试访问受保护的内存位置时,经常会发生崩溃.

在调试器中运行程序并使它崩溃.
崩溃时,查看调用堆栈,并查看崩溃时正在执行的代码.

因为MFC应用程序本质上是多线程的,所以崩溃的线程可能不是您的主线程.如果是这种情况,请在调试器中打开线程窗口,找到您的主线程,然后查看其执行的代码.
A crash is often produced when your program attempts to access a protected memory location.

Run your program in the debugger and make it crash.
When it crashes, view the call stack and see what code is executing when it crashes.

Because MFC apps are inherently multi-threaded, the thread that crashes may not be your main thread. If this is the case, open the thread window in the debugger and find your main thread and see what code it was executing.


28(十进制)对应于WM_ACTIVATEAPP
每当您的应用程序的窗口被激活或取消激活时,都会发送该消息
28(decimal)corresponds to WM_ACTIVATEAPP
it is sent whenever your application''s window is being activated or deactivated


这篇关于当失去对MFC的关注时,应用程序崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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