Link to home
Start Free TrialLog in
Avatar of madonion87
madonion87

asked on

program works in debug but not in release mode

hi

i'm writing a program to read cpu details etc.
but the program will cause 100% cpu usage and not respond under release mode but in debug it works fine
you can find both version at
http://members.optusnet.com.au/madonion87/Debug.zip
http://members.optusnet.com.au/madonion87/Release.zip

someone already suggested that it might be the compiler optimization problem, i tried turning off optimization in MS VS.net 2003 but it doesnt help

any ideas would be very appreciated
Avatar of madonion87
madonion87

ASKER

this might help

"in the release build, after GetMessage is called, it goes on comparing whether the call has failed, and if not calls TranslateMessage and so on but the loop is very tight. whats more odd is the program never seems to pass control to windows, and forever looping and handling messages.

whereas in the debug build, after all messages are handled, program passes control to windows after a GetMessage call."

another guy i know in ocau forum said it, i'm not very sure what he means though
SOLUTION
Avatar of AlexFM
AlexFM

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
lol sorry

you can find the source code at http://members.optusnet.com.au/madonion87/muon.cpp

tell me if you need the header files
Avatar of jkr
>>you can find the source code at ...
>>tell me if you need the header files

Everything that you do not post here is pointless, as it renders the Q worthless for others. Sorry.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
i've already looked at that site, tried turning off optimization as well, didnt help
thats why i want to see if anyone have also experienced the same problem, or know what might have caused it
So, have you also tried to _DEBUG_ your release build then?
When all else fails...

add print statements.
turning off aliasing fixed the problem
i think i will split the points into those who contributed, thanks