Click here to Skip to main content
15,881,898 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm new with MFC c++, I started a project but I don't fine main..I see in cpp:
MFCApplication7.cpp
MFCApplocation7Dlg.cpp
stdaf.cpp
I doon't see main

What I have tried:

I don't find the main, I saw in cpp
Posted
Updated 16-Sep-19 21:49pm

What's the Start Function in MFC Application[^] - "In an MFC application, the entry point is hidden in the library"
MFC under the hood[^]
 
Share this answer
 
Comments
CPallini 17-Sep-19 4:04am    
My 5.
The WinMain implemenation is provided ('hidden') by the MFC framework.
This page, though dated can give you insight: In a typical MFC application we never write WinMain() function so how is it possible to compile and link a windows program with out WinMain()?[^].
More modern MFC probably hides WinMain in another place, but you get the idea.
 
Share this answer
 
Comments
Stefan_Lang 17-Sep-19 3:50am    
Why would you think they ever bothered to move WinMain? AFAIK, in decades they never changed MFC; they only added to it. They never even thought of fixing the dinosaur-age event parameters WPARAM and LPARAM to become decent types - they only added functions and helper types (e. g. DWORD_PTR) to deal with modern requirements such as compiling 64 bit applications.
CPallini 17-Sep-19 4:04am    
Because I've found it in 'atlbase.h' on my Visual Studio 2017 :-)
By the way, thank you.
Rick York 17-Sep-19 11:37am    
WinMain was "hidden" so the CWinApp class would be the primary instantiation. For the most part, they removed all need for exposing the message loop so there is no need to have WinMain exposed either. This is true of WPARAM and LPARAM also because the vast majority of message handling methods are passed useful types and not the "raw" values of the types WPARAM and LPARAM. DWORD_PTR and its siblings were added for portability purposes. One can write code that compiles in 32 and 64-bit modes without changes or ifdefs. I have a lot of code that can do this. These days I really don't need 32-bit code though since I use only 64-bit OSs.
In addition to the above, and my suggestions in your previous two questions. You will not learn MFC programming by posting questions here. There are many books and tutorials available, you should find some that you can work through and get a good understanding of the subject.
 
Share this answer
 
Comments
CPallini 17-Sep-19 4:04am    
My 5.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



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