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
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
从上往下,找到第一条你写的代码, 就是那一条出错.
BUG: Unhandled Exception Using MFC Sockets in Visual C++ 6.0
Last reviewed: September 24, 1998
Article ID: Q193101
BUG: Unhandled Exception Using MFC Sockets in Visual C++ 6.0
Last reviewed: September 24, 1998
Article ID: Q193101
{
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() ?