程序老是报错,找到wincore.cpp中代码如下:BOOL CWnd::DestroyWindow()
{
if (m_hWnd == NULL)
return FALSE; CHandleMap* pMap = afxMapHWND();
ASSERT(pMap != NULL);
CWnd* pWnd = (CWnd*)pMap->LookupPermanent(m_hWnd);
老是 ASSERT( pMan != NULL ) 处报错。
MSDN中也没找到afxMapHWND是什么函数,有哪位高手能给解释一下?

解决方案 »

  1.   

    I guess the window object wrapped by CWnd variable is already been destroyed, so error occurrs when this CWnd destructor try to destroy it again.
    call CWnd::Detach to prevent CWnd destructor from destroying the window.
      

  2.   

    根本就不是上面的代码错误
    而是看看你自己的程序
    也许你的window已经destory了
    还调用 !!
      

  3.   

    去掉assert 函数 使用if 判断 pMap 的值。
    在watch 中察看一下pMap 的value.
    try it ..
      

  4.   

    zhao_as(火山)&oldworm(oldworm) :
    老兄,我当然知道是我的代码错了才导致wincore.cpp的ASSERT。
    我想知道的是这个ASSERT可能是什么原因引起的。还是masterz()说的有理。