Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Release vs Debug

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Here is another question about differing behaviour between release and debug mode.

On Windows NT 4.0 the code works fine.
On Windows 2000 Pro the code works fine in debug mode or release mode if run in the IDE with F5/Go.
On Windows 2000 the code behaves differently in release mode when run outside the IDE or with Ctrl-F5/Execute.

The program doesn't crash but an edit box seems to switch from multi line to single line when it gains focus and back to multi line when it loses focus.

I would include a code snippet here but I have not even been able to isolate the area where the problem occurs. I'd appreciate any insights y'all could provide.
 
In case anyone is interested here's what I found out and how I solved this problem.

There was an object that was being created, destroyed and then re-created later. The RELEASE MODE version on Windows 2000 (and XP) would get the SAME memory location which would have whatever values the object had when it was destroyed. The class incorrectly assumed the object had already been initialized and incorrect behaviour ensued.

The DEBUG MODE version did not exhibit the problem because when the object was created the second time, the memory was initialized to 0xcdcdcdcd... so the object correctly decided it was not initialized and proceeded accordingly.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top