Click to See Complete Forum and Search --> : trouble in executing mfc in vs6.0


kotagiri prabhakar
March 30th, 1999, 01:56 AM
I encountered a problem while running my first mfc application in visual studio6.0. It reads something like this "debug assertion failed" at line 85 in appcore.cpp. It's just fine in release mode.When i tried to debug the error it's popping a message " This program has performed a illegal operation and will be shutdown"

Daniel_143
May 17th, 2000, 08:44 PM
I can tell you that the problem you are encountering is one of the most frustrating problems. The only reason that you are not getting these errors in release build is because a release build is fully optimized and therefore the debbuging macro's (ASSERT,TRACE,etc) do not work, because they are no compiled in release build. Now this tells you that you have an error in your own code. Not necessarily a syntax error, but you are doing something that MFC does not want you to do. If you click on retry on the assert error, and debug on the next. You will be taken into the C++ debugger. From there you can find out why you are getting this error box... an example (This is an example)

ASSERT( hWnd != NULL )

From this you can determine that something is going wrong with hWnd, the best way to pin point your error, is to do step by step debugging. It's tedious...but it works. As much as you curse those assertion failures now, im sure you will be grateful knowing that the user will not get that same error that you got. I can GUARENTEE that it is your code that is causing the error. You must make sure your code is doing EXACTLY what it should be doing, you really have to make sure all parametrs you are using are valid etc. It'll take some work to fish it out, but you can do it.

- Please Rate this post so i cant examine the effectivness of my replies