Author Topic: thanks for reply  (Read 8671 times)

zdai

  • Guest
thanks for reply
« on: November 28, 2007, 02:23:53 am »
Thank you guys. The program in VC++ works well in windows OS. Many people are using it for several years. I have changed anything related to MFC, then compiled and built it in C::B IDE, no warning and no error. When I clicked "RUN" botton on tool bar of C::B IDE, several seconds later the program terminated without error, but the output was not correct. I debugged it step by step, the output was correct. It is that I said "works in debug mode, does not in release". Thanks again.

Offline alchemist

  • Multiple posting newcomer
  • *
  • Posts: 38
    • My Blog
Re: thanks for reply
« Reply #1 on: November 28, 2007, 10:19:32 am »
hello,

why don't you continue your first post?
Kind Regards,
Xavier Miller.
http://xaviermiller.be

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: thanks for reply
« Reply #2 on: November 28, 2007, 01:39:23 pm »
What you describe typically happens if you don't initialise a variable properly. Maybe in the "changed anything related to MFC" something like that happened.

The debugger initialises all variables to 0, so code like if(foo != 0) will work as expected in the debugger but will fail without it.

With some luck, the compiler will give you an appropriate warning if you compile with -Wall (although it does not detect it in every case). Otherwise, this can be a long, painful search.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."