3 ms·
Note that WinMain isn't the "real" entry point either. The C runtime calls WinMain after doing its startup. By convention the entry point is one of: * mainCRTS
by ChrisSD 6y ago
Note that WinMain isn't the "real" entry point either. The C runtime calls WinMain after doing its startup. By convention the entry point is one of:
* mainCRTStartup
* wmainCRTStartup
* WinMainCRTStartup
* wWinMainCRTStartup
Conveniently these all have the exact same function signature (i.e. the real entry point signature). For example:
extern "C" int WinMainCRTStartup()
Although obviously the C runtime implementations differ for each of the listed entry points.
- sumtechguy 6y agohttps://docs.microsoft.com/en-us/cpp/build/reference/entry-entry-point-symbol?view=vs-2019 https://docs.microsoft.com/en-us/cpp/build/reference/entry-e... You can also set what it is using that compiler option if you want. You usually do not want to as the default versions do quite a bit of stuff. I think the winmain one was the 3.x default. But changed when they added in other bits (I want to say threading, and console setup but I could be wrong). Windows is a weird one as it has this odd DOS/VMS/OS2/Win16/32 heritage so entry into the program is one that has some bagage. Winmain is one of those leftovers. The params passed in need to use the functions associated to them. My advice is always with this stuff. read the docs. There is a ton of info in there. It is kind of picky to get just right.