Re: Windows Procedural Programming



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".

.



Relevant Pages

  • Re: Windows Procedural Programming
    ... > One minute [Alf is] saying that a Windows program does not have a WinMain ...
    (comp.programming)
  • Re: Windows Procedural Programming
    ... One minute you are saying that a Windows program does not have a WinMain ... For GUI apps, I've always used WinMain. ...
    (comp.programming)
  • Re: Windows Procedural Programming
    ... Please don't top-post and please don't quote irrelevant material. ... > One minute you are saying that a Windows program does not have a WinMain ... > For GUI apps, I've always used WinMain. ...
    (comp.programming)
  • Re: Adding SDK
    ... unresolved external symbol WinMain referenced in function WinMainCRTStartup ... The entry point of my applications is not WinMain but anyway I've tried to ... If you want to build this application from Platform Builder, ... You should see your new SDK platform ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Executable enty points incorrectly documented
    ... you are absolutely correct in that main / WinMain have nothing to do ... They are, however, the entry points used by most ... they are found under the Windows Management ... My bigger problem however is that the real entry point signature is not ...
    (microsoft.public.win32.programmer.kernel)