Hey, I read on a post in the tutorials section that most ASM coders don't use a WinMain???
Is this really optional?

What is and is not required in a windows ASM application?

Can you just start coding right after the first label? ie


...your code

end Start

thanx from Mr. Confused
Posted on 2002-01-01 14:06:50 by Rockinronstar
I think WinMain is created for C (and other hll) users like you would have a 'main' function in dos/console apps. It is not the actual entrypoint of the program. The compiler adds the GetModuleHandle/GetCommandLine stuff and passes it to the WinMain procedure.
But it's perfectly okay to start writing just after the start label.

Posted on 2002-01-01 14:59:28 by Thomas
I dont use a wndmain in asm. I think it was done that way so you can grasp the concept easier if you know C.
Posted on 2002-01-01 16:22:49 by ChimpFace9000
I don't use WinMain either. As far as I'm concerned, it's just another "call" that isn't needed.

As far as what's "required" you normally do need at least one WndProc. You can name it anything you wish. Just pass that name to wc.lpfnWndProc when you call RegisterClassEx.

Posted on 2002-01-01 16:50:02 by S/390
In VC++ 6, WinMain is not the start address.

VC++ 6 tells the linker to use WinMainCRTStartup or wWinMainCRTStartup as the start address for a "WinMain" app. This invokes the startup code necessary for initializing global C++ objects. After that is done, the startup code invokes WinMain.

In ASM, you're not using the C++ object stuff, so you don't need the startup code. And, yes, you can override the name of the start address.
Posted on 2002-01-02 13:32:41 by tank