I had a working MFC application (a dialog application), I deleted some of its button and added a new button, but now when it closes the application crashes. It fails in one of ASSERT() macro. The debug assertions fails on these lines
File: afxtempl.h Line: 558
When I view that 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 as to what is going wrong? The application was working fine when earlier, but I messed it up.