Click here to Skip to main content
15,878,852 members
Please Sign up or sign in to vote.
4.67/5 (3 votes)
Hi friends,

I want to know why does an application class contain only one object in MFC. Plz tell me.

Thanks & Regards
Sairam
Posted

Because there is only one application in your application... [rolleyes]

 
Share this answer
 
In an executable, there must be one entry point that can be called by the loader, runtime etc.
There cannot be any ambiguity here.

That is why we can have only one main function in a console program and only one WinMain function in a windows program. And that is exactly why we can have only one CWinApp or CWinAppEx instance 'cause this class encapsulates the entry point for the executable.

 
Share this answer
 


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900