Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Debug assertion failures

reevesireevesi Member Posts: 5
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?

Comments

  • AsmGuru62AsmGuru62 Member Posts: 6,519
    : 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?
    :
    [color=Blue]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.[/color]
  • reevesireevesi Member Posts: 5
    : : 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?
    : :
    : [color=Blue]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.[/color]

    This code was working with no problems.
  • AsmGuru62AsmGuru62 Member Posts: 6,519
    : : : 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?
    : : :
    : : [color=Blue]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.[/color]
    :
    : This code was working with no problems.
    :
    [color=Blue]
    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.
    [/color]
Sign In or Register to comment.