"Debug Assertion" Runtime Error on VS2008?

Posted by Linda Cohen on Stack Overflow See other posts from Stack Overflow or by Linda Cohen
Published on 2010-05-07T02:55:30Z Indexed on 2010/05/07 2:58 UTC
Read the original article Hit count: 395

Filed under:
|
|
|

I' writing a C++ MFC program on VS2008 and I'm getting this "Debug Assertion Error" when I first run the program sometimes. When I try to debug it, it takes me to this winhand.cpp file which is not part of the program I wrote so I'm not sure how to debug this.

It takes the error to this place in winhand.cpp

CObject* pTemp = LookupTemporary(h);

if (pTemp != NULL) { // temporary objects must have correct handle values HANDLE* ph = (HANDLE*)((BYTE*)pTemp + m_nOffset); // after CObject ASSERT(ph[0] == h || ph[0] == NULL); if (m_nHandles == 2) ASSERT(ph[1] == h); }

So why does this error happen? Why does it only happen sometimes (50% of the time)? How would I debug this?

I'll provide some code if is needed.

THANKS!

© Stack Overflow or respective owner

Related posts about mfc

Related posts about c++