Jump to content
  • Advertisement
Sign in to follow this  
jjmontes

Why should I...

This topic is 5453 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

... do this at the end of my WinMain? return ((int) msg.wParam); I was returning that but I moved my msg loop to another place, so I'm now returning 0 always. Is this wrong? Is that the errorlevel? If so, I'm not interested in that. I'm not a Windows guy so I'm not sure about though. Thank you,

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
If the return value is non zero, it indicates to the operating sytem or whatever called your program that there was an error. *I think*

Share this post


Link to post
Share on other sites
The wParam member of the MSG structure holds the exit code that was passed to PostQuitMessage.

Share this post


Link to post
Share on other sites
You should be fine with returning zero. And if you crash and you call exit to terminate yourself, specify something different from zero to be the return code. Just to satisfy the idea [smile] But as I said - I don't think, there's nothing wrong with just returning zero.

Btw - yes, if your program exits with value other than 0 it indicates an error...

Oxyd

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
The only reason to use the return code is if your program is used by a batch (or by other programs) that want to know if your program failed so the batch (or other program) can deal with that.

Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster
The only reason to use the return code is if your program is used by a batch (or by other programs) that want to know if your program failed so the batch (or other program) can deal with that.


I made a console program which interacted with a a .bat file 2 days ago :). Took a while to get it right tho. Been a while since I've used dos :)
Returncodes and errorlevels are great, but if I'd have to do it again i'd probably do everything in c++.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!