描述:
在多文档中,我将子框架类和视图类写到了COM中,开始运行一切正常,过了几十秒之后,提示错误,
错误在CWND::WalkPreTranslateTree(HWAND hWndStop,Msg *pMsg) 中,
BOOL PASCAL CWnd::WalkPreTranslateTree(HWND hWndStop, MSG* pMsg)
{
///此时pMsg->Message 等于0x200,WPARAM 为0
ASSERT(hWndStop == NULL || ::IsWindow(hWndStop));
ASSERT(pMsg != NULL);
// walk from the target window up to the hWndStop window checking
// if any window wants to translate this message
for (HWND hWnd = pMsg->hwnd; hWnd != NULL; hWnd = ::GetParent(hWnd))
{
CWnd* pWnd = CWnd::FromHandlePermanent(hWnd);
if (pWnd != NULL)
{
// target window is a C++ window
if (pWnd->PreTranslateMessage(pMsg)) //就死在这里了 return TRUE; // trapped by target window (eg: accelerators)
}
// got to hWndStop window without interest
if (hWnd == hWndStop)
break;
}
return FALSE; // no special processing
}
在线等待!
解决方案1:
太难了,看不懂,不排除有其他错误,我可以看看吗?
zeng_ya@hotmail.com
Gz
解决方案3:好像是窗口已经消失,但还是发消息给它,造成消息不能处理
解决方案4: 没看出来
但我觉得FromHandlePermanent用得不好,换一个试试
用到了多线程么?可能是同步的问题.