Subj : Re: Windows Procedural Programming To : comp.programming From : Rob Thorpe Date : Mon Jul 25 2005 03:55 am 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". .