运行时不时地 就会跳出 Assert Failed  wincore.cpp  第980行 看日志 不是某个固定环境 条件的触发导致错误 所以也没法debug
看过这个wincore.cpp 980行 也看不出什么明堂 哪位高手遇见过的说说看 可能是什么原因导致的?

解决方案 »

  1.   

    VIEW->DEBUG WINDOW->CALL STACK
    从上往下,找到第一条你写的代码, 就是那一条出错.
      

  2.   

    你debug一下,单步跟踪进去,看看为什么会assert出错,不就知道了吗
      

  3.   

    do you use MFC Sockets?this is maybe a reason.
    BUG: Unhandled Exception Using MFC Sockets in Visual C++ 6.0
    Last reviewed: September 24, 1998
    Article ID: Q193101
      

  4.   

    do you use MFC sockets,this maybe a reason.
    BUG: Unhandled Exception Using MFC Sockets in Visual C++ 6.0
    Last reviewed: September 24, 1998
    Article ID: Q193101
      

  5.   

    换到Release版取,什么都没有了。
      

  6.   

    "不是某个固定环境 条件的触发导致错误 所以也没法debug" 我这话是不是不够明了啊 还有这么多人说debug 能debug到就不在这问了
      

  7.   

    BOOL CWnd::DestroyWindow()
    {
    if (m_hWnd == NULL)
    return FALSE; CHandleMap* pMap = afxMapHWND();
    ASSERT(pMap != NULL);
    CWnd* pWnd = (CWnd*)pMap->LookupPermanent(m_hWnd);
    #ifdef _DEBUG
    HWND hWndOrig = m_hWnd;
    #endif#ifdef _AFX_NO_OCC_SUPPORT
    BOOL bResult = ::DestroyWindow(m_hWnd);
    #else //_AFX_NO_OCC_SUPPORT
    BOOL bResult;
    if (m_pCtrlSite == NULL)
    bResult = ::DestroyWindow(m_hWnd);
    else
    bResult = m_pCtrlSite->DestroyControl();
    #endif //_AFX_NO_OCC_SUPPORT// Note that 'this' may have been deleted at this point,
    //  (but only if pWnd != NULL)
    if (pWnd != NULL)
    {
    // Should have been detached by OnNcDestroy
    #ifdef _DEBUG
    ASSERT(pMap->LookupPermanent(hWndOrig) == NULL); // 980 行
    #endif
    }
    else
    {
    #ifdef _DEBUG
    ASSERT(m_hWnd == hWndOrig);
    #endif
    // Detach after DestroyWindow called just in case
    Detach();
    }
    return bResult;
    }你有没有自己映射这个窗口的 WM_NC_DESTROY 函数, 如果映射了, 在你自己的 OnNcDestroy 里面有没有调用 CWnd::OnNcDestroy() ?
      

  8.   

    <<<<  "不是某个固定环境 条件的触发导致错误 所以也没法debug" 我这话是不是不够明了啊 还有这么多人说debug 能debug到就不在这问了.楼主也真有意思,既然有了错误了,也弹出assert dialog了,看一下call stack,为什么会不行呢?是不是你不知道如何看call stack?