C and C++

Moderators: None (Apply to moderate this forum)
Number of threads: 28695
Number of posts: 94715

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Debug assertion failures Posted by reevesi on 13 Nov 2008 at 4:20 AM
Hi I am returning to programming after some time doing other things. I took on some Visual C++ 2003 applications that were working. I made some changes and everything was OK. Then somehow I lost references to additional MySQL libraries and KeyLok2 libraries. I added these back and got clean compile and link. But now I get "debug assertion failures" in files like afxwin1.ini, wingdix.cpp and wingdi.cpp. This did not happen before. Does anyone have any idea what I need to do to get debugging again?
Report
Re: Debug assertion failures Posted by AsmGuru62 on 13 Nov 2008 at 4:55 AM
: Hi I am returning to programming after some time doing other things.
: I took on some Visual C++ 2003 applications that were working. I
: made some changes and everything was OK. Then somehow I lost
: references to additional MySQL libraries and KeyLok2 libraries. I
: added these back and got clean compile and link. But now I get
: "debug assertion failures" in files like afxwin1.ini, wingdix.cpp
: and wingdi.cpp. This did not happen before. Does anyone have any
: idea what I need to do to get debugging again?
:
Run your code in debugger and when you get an Assertion Message Box - simply click "Debug" button. It should bring you to the source code line where assertion fired. After this, select "Show Call Stack" command and tracking back - you will see which line of your code causes the assertion. Thinking logically, it is almost always possible to quickly determine the real cause. Like window (or other object) handle is not created yet or some pointer is NULL.
Report
Re: Debug assertion failures Posted by reevesi on 13 Nov 2008 at 5:45 AM
: : Hi I am returning to programming after some time doing other things.
: : I took on some Visual C++ 2003 applications that were working. I
: : made some changes and everything was OK. Then somehow I lost
: : references to additional MySQL libraries and KeyLok2 libraries. I
: : added these back and got clean compile and link. But now I get
: : "debug assertion failures" in files like afxwin1.ini, wingdix.cpp
: : and wingdi.cpp. This did not happen before. Does anyone have any
: : idea what I need to do to get debugging again?
: :
: Run your code in debugger and when you get an Assertion
: Message Box - simply click "Debug" button. It should bring you to
: the source code line where assertion fired. After this, select "Show
: Call Stack" command and tracking back - you will see which line of
: your code causes the assertion. Thinking logically, it is almost
: always possible to quickly determine the real cause. Like window (or
: other object) handle is not created yet or some pointer is
: NULL.


This code was working with no problems.
Report
Re: Debug assertion failures Posted by AsmGuru62 on 13 Nov 2008 at 5:15 PM
: : : Hi I am returning to programming after some time doing other things.
: : : I took on some Visual C++ 2003 applications that were working. I
: : : made some changes and everything was OK. Then somehow I lost
: : : references to additional MySQL libraries and KeyLok2 libraries. I
: : : added these back and got clean compile and link. But now I get
: : : "debug assertion failures" in files like afxwin1.ini, wingdix.cpp
: : : and wingdi.cpp. This did not happen before. Does anyone have any
: : : idea what I need to do to get debugging again?
: : :
: : Run your code in debugger and when you get an Assertion
: : Message Box - simply click "Debug" button. It should bring you to
: : the source code line where assertion fired. After this, select "Show
: : Call Stack" command and tracking back - you will see which line of
: : your code causes the assertion. Thinking logically, it is almost
: : always possible to quickly determine the real cause. Like window (or
: : other object) handle is not created yet or some pointer is
: : NULL.

:
: This code was working with no problems.
:

Are you compiling in VS 2005? If so, then this may be the changes in run-time library and other things (CString became worse, as an example). We had big issue moving from VS 2003 to VS 2005. Both in compilation errors and run-time.

If you compiling with same VS 2003 compiler - then OS probably changed. Did you get any service packs applied?

In any event, instead of guessing - simply fire the debugger.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.