From: "A. Sinan Unur" Newsgroups: comp.os.msdos.djgpp Subject: Re: void main ? Date: Mon, 07 Jul 1997 17:08:03 -0400 Organization: Cornell University http://www.cornell.edu Lines: 41 Sender: asu1 AT cornell DOT edu (Verified) Message-ID: <33C15AB3.42F0@cornell.edu> References: <97Jul7.170831gmt+0100 DOT 16651 AT internet01 DOT amc DOT de> Reply-To: asu1 AT cornell DOT edu NNTP-Posting-Host: cu-dialup-0065.cit.cornell.edu Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Chris Croughton wrote: > > For that matter, when it comes to Windows programs you > can forget the result code as well, because the startup > and exit interface is very different. i have a bunch of WinCGI programs that spawn console apps (using CreateProcess) under win32. i can the use GetExitCodeProcess to examine whether the form was processed successfully etc. and, to prevent misunderstandings, this what the MSVC 4.0 docs say about WinMain's return value (which is also int): WinMain initializes an application, and then performs a message retrieval-and-dispatch loop that is the top-level control structure for the remainder of the application's execution. The loop terminates when a WM_QUIT message is received. At that point, WinMain exits the application, returning the value passed in the WM_QUIT message's wParam parameter. If WM_QUIT was received as a result of calling PostQuitMessage, the value of wParam is the value of the PostQuitMessage function's nExitCode parameter. nobody is contesting that matters are quite different for applications that are not hosted (such as mobile phones, microwave ovens etc.) the C faq also makes it clear that the discussion applies only to hosted applications. but the fact remains that to be conforming, main must return an int. -- Sinan ******************************************************************* A. Sinan Unur WWWWWW |--O+O mailto:sinan DOT unur AT cornell DOT edu C ^ http://www.people.cornell.edu/pages/asu1/ \ ~/ Unsolicited e-mail is _not_ welcome, and will be billed for. *******************************************************************