How to change entry point to _tmain() for MFC Application
How do I change the entry Point of my MFC App开发者_JAVA技巧lication ? Standard is InitInstance()
of the class that extends CWinApp
. But I need the entry Point at _tmain()
. Will call initInstance()
from there...
You can set entry point of application by specifying linker option "/entry:myMain" or via pragma directive:
#pragma comment(linker, "/entry:myMain")
See the official /Entry documentation for VC++ 2010 for how to set it and what the defaults are. Note that main()
and InitInstance()
may be the entry point for your code but it not necessarily the original entry point for the program. For example, trace into a MFC program and you'll see a large amount of initialization code that you probably don't want to skip.
精彩评论