1.stdafx. * What is it? how to use? Windows and MFC's include files are very large, even if there is a fast handler, the compiler also costs a considerable time to complete the job. Since each .CPP file contains the same include file, it is very stupid to repeat these files for each .cpp file. To avoid this waste, AppWizard and Visual C compilers work together, as shown below: ◎ AppWizard established file stdafx.h, which contains all the MFC Include files required for all current project files. And this file can vary with the option selected. ◎ AppWizard then establishes stdafx.cpp. This file is usually the same. ◎ Then AppWizard builds a project file, so the first compiled file is stdafx.cpp. ◎ When Visual C compiles the stdafx.cpp file, it saves the result in a file called stdafx.pch. (Extended PCH represents the pre-compiled head file.) ◎ When Visual C is compiled, it reads and uses the .pch file that it just generated when each .cpp file is compiled. Visual C no longer analyzes the Windows Include file unless you have edited stdafx.cpp or stdafx.h.
2. What is the difference between the handle and ID? What is "handle" (Handle), the intention of Handle is the handle, handle. It is the stuff with your operating system. For example, if you have made a university, after enrollment, the school (operating system) will give you a student card number. Note that this number is specified by the school, you can't choose from. With this number (student card, assume a copy) to enjoy the services provided by the school: If you can go to the library to borrow books, go to the canteen to eat, go to the classroom to wait. But you can't buy beer in the cafeteria because the school does not allow this service. The service provided in the computer is the API call. You have a handle, you can make a service to the system to call the API service. The power of the pointer is mostly, with a pointer you can drink everywhere, fight, school (operating system) tube, so the degree of handle and pointer is the service provided by the handle pointer call system. Although the handle is a number that can be distinguished, there is another difference between our ordinary ID, and the ordinary ID number can be defined by the programmer himself, and the handle is not, it is the object generation is the system specified, it is for Different objects existing in the system, this handle is not given by the programmer.