This is called "entry point":
http://en.wikipedia.org/wiki/Entry_point[
^].
In Windows, the conventional entry point is
WinMain
:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms633559%28v=vs.85%29.aspx[
^].
In an MFC application, the entry point is hidden in the library, reportedly, in the file "Appmodule.cpp". Actually, the entry point name is defined as
_tWinMain
, which is a generic name for Unicode ("wide"
wWinMain
) and non-Unicode (
WinMain
) entry-point names, a way to abstract out from Unicode option.
This CodeProject article explains how it works with MFC:
MFC under the hood[
^].
See the section "So, what happened to good old WinMain?"… :-)
[EDIT]
Now, some advanced background information:
We can see that different platforms based on PE files (
http://en.wikipedia.org/wiki/Portable_Executable[
^]) use different names for entry-point functions, and also, for different Windows-based platforms and/or frameworks, one entry point function calls another "secondary" entry function which is the only one exposed to the framework user. We can investigate it all, but does it make much sense? Ultimately, even the very top function on the call stack, "real" entry point,
does not have to have a certain standard name. This is so because that "real" entry point is found not by the name, but by the address in the header structure used for this purpose. Please see:
http://en.wikibooks.org/wiki/X86_Disassembly/Windows_Executable_Files#PE_Optional_Header[
^].
—SA