i am doing a mdi project in vis开发者_如何学Cual c++ using mfc i am using a CArray to save and load data to documents. CArray contains members of a custom class of mine.
Saving and loading works fine
I get access violation when closing a document that i have opened, and debugger points me to carray.
the weird thing is that i can close without problem "new" documents and the program crashes only when i am trying to close a document that i "open".
any idea how to fix it?
debugger points me to that code
i got the message "TYPE not found"
CArray::~CArray() { ASSERT_VALID(this);
if (m_pData != NULL) { for( int i = 0; i < m_nSize; i++ ) (m_pData + i)->~TYPE(); delete[] (BYTE*)m_pData; } }
what code u want to see exactly?
forgot to mention that if i open an empty document closing is working fine as well
精彩评论