在DispatchMessage崩溃,为什么?(Crash in DispatchMessage, why)

   IT问题网   2021-02-19 00:00:00

问 题

嗨,亲爱的:



我有一个工作线程,里面有一个窗口。线程proc如:



 unsigned __stdcall threadfunc(void * param)
{
mywindow mywin;
msg msg;
bool bret;
while((bret = getmessage(amp; msg,null,0,0))!= 0)
{
if(bret == -1)
{
//处理错误并可能退出
}
else
{
translatemessage(amp; msg);
dispatchmessage(amp; msg);
}
}
return(int)msg.wparam;
}


mywindow派生自cwindowimpl。现在我的问题是这个程序在dispachmessage中随机崩溃,如崩溃报告中的minidump所示。



可能是什么问题?

解决方案

崩溃很可能是一个更深层的功能。调试器在 dispatchmessage 函数中显示它,因为它是最近的源代码可用。



是c ++调试器能够显示所有堆栈跟踪条目,而不仅仅是那些有源代码的条目?



这有助于检测真正的问题。



干杯

uwe

是的,当我使用windbg打开minidump时,我得到了所有堆栈跟踪,如下所示:

00 1a14f398 76cd86ef 0xfdf920e

01 1a14f3c4 76cd8876 user32 + 0x186ef

02 1a14f43c 76cd70f4 user32 + 0x18876

03 1a14f498 76cccea0 user32 + 0x170f4

04 1a14fcc8 771d647e user32 + 0xcea0

05 1a14fd34 21725f86 ntdll + 0x4647e

06 1a14ff38 1a14ff20 rjck!threadfunc + 0xb6

或类似:

00 1a14f398 76cd86ef 0xfdf920e

01 1a14f3c4 76cd8876 user32!internalcallwinproc + 0x23

02 1a14 f43c 76cd70f4 user32!usercallwinproccheckwow + 0x14b

03 1a14f498 76cccea0 user32!dispatchclientmessage + 0xda

04 1a14fcc8 771d647e user32!__ fnoutstring + 0x63

05 1a14fcd0 00000000 ntdll!kiusercallbackdispatcher + 0x2e

并且msg很常见,就像wm_timer一样。这是有线的。我认为原因是在首先处理所有msg in循环之前销毁了window类。但是当句柄无效时,getmessage将返回-1。现在我认为堆栈可能在某些窗口proc中失败,然后在它返回时崩溃。或者也许我的win proc被其他代码破坏,是否可能?

标签:崩溃为什么为何



分享:

  • 微信
  • QQ好友
  • QQ空间
  • 新浪微博


热门推荐

导出HTML内容以打开办公室应用程序时出现问题。(Problem when export an HTML content to open office application.)

problem hello all. i am facing a problem when i am tryin ...

将数据从CSV导入Oracle(Importing Data from CSV to Oracle)

problem hi i want to import the data from csv to oracle, ...

如何使用存储过程传递id(how to pass id for where using stored procedure)

problem how to pass id for where condition when using mys ...

使用cookie值加载gridview(Load gridview using a cookie value)

problem i have a method to load a gridview according to a ...

只有添加足够的行才能启用垂直滚动条,才会显示ClistBox(ClistBox doesn't display until enough lines are added to enable the vertical scroll bar)

problem i have an application that adds lines to a list b ...

DateTime数据类型的算术运算。(Arithmetic Operations on DateTime Datatype.)

problem hi, i have been trying to find a way to do arit ...

将图像插入Word(Insert Image to Word)

problem how to compress inserted image in word using dsof ...

我如何缩进给定的XML(how can i indent a given XML)

problem is there any easiest way to indent given xml i ...

我想将Outlook消息保存到sql server db(i want to save outlook messages to sql server db)

problem hi could you please help me on saving outlook m ...

我如何在cookie中保存令牌(how I can save the token in the cookie)

problem hi, i am creating the web service au ...

C#.net中的ModalPopupExtender(ModalPopupExtender in C#.net)

problem while i am clicking the modal popup extender wind ...

需要帮助来更改密码表格(need help to change password form)

problem hi everyone, i am still newbie in vb. ...

CMap或CMapPtrToPtr(CMap or CMapPtrToPtr)

problem hi, i want store the objects in cmap ...

如何创建新的任务栏(how to create new task bar)

problem hi, i want to create new taskbar,can any one hel ...

在C#.net中旋转PDF文件(Rotate PDF File in C#.net)

problem hi , how to rotate pdf file in c#.net ...

在C#.Net中旋转图像文件(Rotate Image Files in C#.Net)

problem hi, how to rotate image files(jpeg,ti ...

如何交换字符串中的字符(how to swap characters in a string)

problem hi all. i''m new in .net and i want t ...

如何在SHAREPOINT 2010中集成twitter(How to integrate twitter in SHAREPOINT 2010)

problem hi to all, this is siddiqali working ...

检查应用程序是否正在运行(Check If Application Is Running)

problem is there a way to run a loop that wou ...

如何使用radiobuttonlist?(how to use radiobuttonlist)

problem i want to write select query for selectedindexcha ...