Mail Archives: djgpp/1997/07/08/22:03:19
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.
*******************************************************************
- Raw text -