Transferred from: http://www.jizhuomi.com/software/143.html
After using the Application Wizard to generate the framework program, we can see a folder named after the solution name under the location of the previous settings, which contains several files and a subfolder named after the project name, which contains several files and a res folder. When you create a project, the files under the project folder may also differ.
If you have compiled the link in debug mode, you will have a folder named "Debug" under the Solution folder and the Project subfolder, and if you compile with release, you will be named "release". These two compilations will result in two different versions of the executable program:Debug version and release version . The debug version of the executable contains the information and code for debugging, while the release version does not have debug information and cannot be debugged, but the executable file is relatively small.
All files are now divided into 6 parts: solution-related files, project-related files, application header files and source files, resource files, precompiled header files, and compilation links to deliver files.
1. Solution-related Documents
Solution-related files include the. sdf file, the. sln file, the. suo file, and the Ipch folder under the solution folder.
The. sdf file and the IPCH directory typically occupy a larger space, a few 10 trillion or even hundreds of megabytes, related to smart hints, error hints, code recovery, and team local repositories. If you feel you don't need to, you can set them up without generating them by clicking the menu bar tools->options, pop Up the Options dialog, select the text editor->c/c++->advanced in the left panel, The first item in the list on the right disable database is changed from false to true, and the last time you close VS2010 and then delete the. sdf file and the IPCH directory will not be created again. However, there will be a lot of inconvenience when this option is turned off, such as the smart tip when writing a program.
The. sln file and the. suo file are the MFC auto-generated solution files that contain the project information in the current solution and the settings for the storage solution.
2. Engineering Related Documents
Project-related files include. vcxproj files and. vcxproj.filters files under the project folder.
The. vcxproj file is an MFC-generated engineering file that contains information about the current project's settings and the files that the project contains.. vcxproj.filters files store the project's virtual directory information, which is the directory structure information in the solution browser.
3. Application header files and source files
Depending on the type of application (single document, multi-document, or dialog-based program), the Application Wizard automatically generates some header and source files that are the body of the project and are used to implement the main frame, document, view, and so on. Below is a brief description of each file:
HelloWorld.h: The primary header file for the application. It mainly contains the declaration of the Chelloworldapp class derived from the CWinAppEx class, and the declaration of the Global object Theapp of the Chelloworldapp class.
HelloWorld.cpp: The main source file for the application. It mainly contains the implementation of Chelloworldapp class, the definition of global object Theapp of Chelloworldapp class, etc.
MainFrm.h and MainFrm.cpp: These two files derive CMainFrame classes from the CFrameWndEx class for creating the main frame, menu bar, toolbars, and status bar.
HelloWorldDoc.h and HelloWorldDoc.cpp: These two files derive the document class Chelloworlddoc from the CDocument class, containing some of the documents used to initialize the document, Serialize (Save and load) the document and debug member functions.
HelloWorldView.h and HelloWorldView.cpp: They derive from the CView Class A view class known as Chelloworldview, which is used to display and print document data, including some drawings and member functions for debugging.
ClassView.h and ClassView.cpp: derived from the CDockablePane class Cclassview class for implementing class View on the left panel of the application interface.
FileView.h and FileView.cpp: derived from the CDockablePane class Cfileview class for implementing file View on the left panel of the application interface.
OutputWnd.h and OutputWnd.cpp: derived from the CDockablePane class, the Coutputwnd class is used to implement the side panel output under the application interface.
PropertiesWnd.h and PropertiesWnd.cpp: derived from the CDockablePane class Cpropertieswnd class for implementing the Application interface right panel properties.
ViewTree.h and ViewTree.cpp: The Cviewtree class is derived from the CTreeCtrl class for implementing a tree view that appears in ClassView, FileView, and so on.
4. resource Files
Generally we use the MFC Build Window program will have dialog boxes, icons, menus and other resources, the Application Wizard will generate resource-related files: Res directory, helloworld.rc file and Resource.h file.
Res directory: The Res directory under the project folder contains icon files such as application default icons, toolbar use icons, and so on.
HELLOWORLD.RC: Contains the default menu definition, String table, and accelerator key table, specifying the default About dialog box and application default icon file.
Resource.h: Contains ID definitions for various resources.
5. Precompiled Header File
Almost all MFC programs contain files such as AFXWIN.h, and if compiled once each time, the compilation speed will be greatly slowed down. So the commonly used MFC header files are placed in the StdAfx.h file, and then by Stdafx.cpp contains stdafx.h files, the compiler compiles the stdafx.cpp only once, and generates compiled precompiled header helloworld.pch, greatly improving the efficiency of the compilation.
6. Compile the link to the file
If it is compiled in debug mode, the Debug subfolder is generated under both the solution folder and the project folder, and the release subfolder is generated if the release method is compiled.
The Debug or Release subfolder under the project folder contains the intermediate files that are generated when the link is compiled, and the debug or Release subfolder under the solution folder primarily contains the executable file for the application.
VS2010-MFC (Composition of files in VS2010 application engineering)