The MAIN.C file (located in the \TOOLKIT\SAMPLES\OPEN32\WINMAIN subdirectory) is provided as a helper (stub) to demonstrate how to invoke the Windows WinMain function from OS/2.
This is the "main" wrapper for an application based on Open32. It initializes the Alternative Windows Emulator (AWE) environment, calls the WinMain function, and upon completion, calls the WinTerm function to shut down the AWE environment.
Note: To be able to use the Windows WinMain() function, use the OS/2 Warp main() function located in the MAIN.C file. MAIN.C gets compiled and linked with the module containing WinMain() and creates an OS/2 Warp executable file. If you do not use the OS/2 Warp main() function, you will receive a link error stating that there is no starting address for your program.