MFC in Theapp

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.