MFC application crashes when closing

I had a working MFC application (dialog application), I deleted part of its button and added a new button, but now when it closes the application, it crashes. It does not work in one of the ASSERT () macros . Debug statements do not execute on these lines

File: afxtempl.h Line: 558

When I look at this code, it was something like this

template<class TYPE, class ARG_TYPE>
void CArray<TYPE, ARG_TYPE>::AssertValid() const
{
    CObject::AssertValid();

    if (m_pData == NULL)
    {
        ASSERT(m_nSize == 0);
        ASSERT(m_nMaxSize == 0);
    }
    else
    {
        // here it fails
        ASSERT(m_nSize >= 0);
        ASSERT(m_nMaxSize >= 0);
        ASSERT(m_nSize <= m_nMaxSize);
        ASSERT(AfxIsValidAddress(m_pData, m_nMaxSize * sizeof(TYPE)));
    }
}
#endif //_DEBUG

Any clues about what's going wrong? The app worked fine when before, but I messed it up.

+3
source share
3 answers

, - , -. , , 0xdddddddd , .

+1

, , resource.h. , , / , , .

0

- MFC . , , , - . , .

0
source

Source: https://habr.com/ru/post/1717711/


All Articles