Summary of Theapp Usage:
1.THEAPP is the head of your project, you can get the entire process pointer through AfxGetApp (), and then through it, you can get the HWND of the process as well as the hinstance, and the menu ... Wait a minute. Ranging More information can be obtained from MSDN
2.THEAPP is a global variable that can be referenced almost anywhere in the program. If you build an MDI or SDI project, you can see that a class ends with *app, and this theapp is an instance of it, and the public variables that are added to this class can be referenced by Theapp. Of course, since WinApp is its base class, Theapp saves a lot of information about the duration of the program, such as executing program names, paths, etc.
3. Add a member and method, you can use AfxGetApp access at any time
4.THEAPP is an object of the derived class of the CWinApp class and is a global variable. Global variables are created before WinMain ().
5.THEAPP is an example of an application and you can't do anything without him! He's starting the process!
Position:
Located at (Cxxxxxx.cpp):
The one and only Cxxxxxxapp object
Cxxxxxxapp Theapp; Here
/////////////////////////////////////////////////////////////////////////////
MFC in Theapp