Re: Windows Procedural Programming
- From: "Rob Thorpe" <robert.thorpe@xxxxxxxxxxxx>
- Date: 25 Jul 2005 02:55:16 -0700
Joe Butler wrote:
> One minute you are saying that a Windows program does not have a WinMain
> instead of a main, and the next you are saying that main is a requirement of
> the standard and that it must be used?
>
> You seem to be confused.
>
> For GUI apps, I've always used WinMain.
> for CUI app, I've always used main.
>
> Simple as that.
>
> You're not actually trying to be helpful, are you. You're just trying to be
> smart. I've had the misfortune of working with people like you in the past.
> Sorry.
The main/WinMain argument is not really that complex or simple:
In Windows you can use either WinMain or main as the entry point.
"main" has the advantage of being standard C, but that's a very small
advantage given that a Win32 program will be compiled on a compiler for
Win32 that will also support WinMain as the entry point. If your
program supports several OSes then it may be useful to use main as the
entry point in every case. It also has the small advantage that argc
and argv processing can be done in the normal way (using WinMain one
must use the global variables _argc and _argv).
WinMain has the small advantage that it gives the programmer the
instance handle straight away as an argument. Sometimes this is
useful, but it's only a function call away if you use "main".
.
- References:
- Windows Procedural Programming
- From: Snooze
- Re: Windows Procedural Programming
- From: Joe Butler
- Re: Windows Procedural Programming
- From: Alf P. Steinbach
- Re: Windows Procedural Programming
- From: Joe Butler
- Re: Windows Procedural Programming
- From: Alf P. Steinbach
- Re: Windows Procedural Programming
- From: Joe Butler
- Windows Procedural Programming
- Prev by Date: How to retrive data from the EMRPOLYDRAW of a Metafile
- Next by Date: Re: Academic grades should be USELESS
- Previous by thread: Re: Windows Procedural Programming
- Next by thread: Re: Windows Procedural Programming
- Index(es):
Relevant Pages
|