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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Application only working in debug !!

Status
Not open for further replies.

sjmolloy

Programmer
Aug 23, 2001
14
GB
I am using Microsoft Visual Studio 6.0 to build a “simple” C++ application.
Basically, in the dialog box, the user should :
·select an item from a list box
·click on a button
·some processing is done by the application
·the dialog is updated and some text should appear in an edit box that forms part of the dialog.

Unfortunately, when I run this nothing happens when the button is clicked. However, if I step through the code in debug it all works.
Interestingly enough, part of the processing that happens after the button is clicked is a WriteFile( ) operation (application is writing to com ports). I have found that if I put in a message box directly after this with just any old debug message in it tha application then runs. Obviously though I don’t want the user to have to “OK” an extra message box just to get the application to work !!

Anyone got any ideas even what sort of problem I am looking at ?????
 
this can be because of asserts. In release mode they means nothing.
for example
assert(x++);
in debug mode and in release mode are two absolutely different things, because in debug mode it is something like a calling of a function, but in release mode it means only an increment. Ion Filipski
1c.bmp


filipski@excite.com
 
Thanks for reply - cause was a number of variables not initialised . The debugger was initialising them by default and spoiling me !!!
Lesson learned !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top