File composition of vs2017

Divide all files into 6 parts: solution related files, engineering related files, application headers

Files and source files, resource files, pre-compiled header files and compiled link generation files.

1. Solution related documents

Solution related files include .sdf files, .sln files, .suo files and ipch files in the solution folder

Folder.

The .sdf file and ipch directory generally occupy a relatively large space, tens of megabytes or even hundreds of megabytes.

Display, code recovery and team local warehouse

The .sln file and .suo file are the solution files automatically generated by MFC, and it contains the projects in the current solution.

Information, storage solution settings.

2. Engineering related documents

This folder is the solution folder. The "Camera Calibration 3" inside is the project folder.

Project related files include .vcxproj file and .vcxproj.filters file in the project folder.

The .vcxproj file is a project file generated by MFC, which contains the settings of the current project and the files included in the project, etc.

information. The .vcxproj.filters file stores the virtual directory information of the project, that is, the directory structure in the solution browser

建 信息。 Structure information.

3. Application header files and source files

The application wizard is automatically generated according to the type of application (single document, multi-document or dialog-based program)

Into some header files and source files, these files are the main part of the project, used to implement the main frame, documents, views, etc.

The following is a brief introduction to each file:

HelloWorld.h: The main header file of the application. Mainly contains CHelloWorld derived from CWinAppEx class

The declaration of the App class, and the declaration of theApp, the global object of the CHelloWorldApp class.

HelloWorld.cpp: The main source file of the application. Mainly contains the implementation of CHelloWorldApp class, CHell

oWorldApp class global object theApp definition etc.

MainFrm.h and MainFrm.cpp: CMainFra is derived from the CFrameWndEx class through these two files

The me class is used to create the main frame, menu bar, toolbar, and status bar.

HelloWorldDoc.h and HelloWorldDoc.cpp: these two files derive the document class from the CDocument class

CHelloWorldDoc, contains some member letters used to initialize documents, serialize (save and load) documents and debug

number.

HelloWorldView.h and HelloWorldView.cpp: they are derived from the CView class named CHelloWorld

View's view class, used to display and print document data, contains some drawing and member functions for debugging.

ClassView.h and ClassView.cpp: CClassView class derived from CDockablePane class, used for

Implement Class View on the left panel of the application interface.

FileView.h and FileView.cpp: The CFileView class is derived from the CDockablePane class, which is used to implement

Use File View on the left panel of the program interface.

OutputWnd.h and OutputWnd.cpp: COutputWnd class is derived from CDockablePane class, use

To realize the output of the lower panel of the application interface.

PropertiesWnd.h and PropertiesWnd.cpp: CProperties are derived from the CDockablePane class

The Wnd class is used to implement the Properties on the right panel of the application interface.

ViewTree.h and ViewTree.cpp: derived from CTreeCtrl class CViewTree class, used to achieve

Tree views in ClassView, FileView, etc.

4. Resource files

Generally, we use MFC to generate window programs 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 icons such as the application ’s default icons and toolbar icons

file.

HelloWorld.rc: Contains the default menu definition, string table, and accelerator key table, and specifies the default About dialog

Box and application default icon files, etc.

Resource.h: Contains ID definitions of various resources.

5. Pre-compiled header files

Almost all MFC program files must include afxwin.h and other files.

Slow down the compilation speed. So put the commonly used MFC header files into the stdafx.h file, and then packaged by stdafx.cpp

Contains the stdafx.h file, the compiler only compiles stdafx.cpp once, and generates a pre-compiled header HelloWorl after compilation

d.pch greatly improves the compilation efficiency.

6. Compile and link to generate files

If it is compiled in Debug mode, the Debug subtext will be generated in the solution folder and the project folder

Folder, and if it is compiled in Release mode, a Release subfolder is generated.

The Debug or Release subfolder under the project folder contains the intermediate files generated during compilation and linking.

The Debug or Release subfolder under the solution folder (in the x64 in the figure, x64 compiled will create an x64 folder, x86 compiled without a folder) mainly contains the executable file of the application. When it is used by others, it is usually enough to use the Debug or Release folder here, but not others.

The VS working directory is generally the project folder, not the solution folder. This working directory is used for debugging, which is used when running the program in the VS. To run the program in the VS, the resources used should be placed in this Under the working directory. If you don't use vs, open the exe file in the debug or release folder in the solution folder (this is done at the time of release). At this time, the working directory is the debug or release folder. Copy the resource files in the previous directory. In general, it is necessary to copy the external library here to successfully publish.

(It is necessary to understand the working directory because: relative paths are generally written in the program, that is, they are not written from the D drive and the E drive. If you write an absolute path, the program is issued to others and the path will not be up.

 

 

Published 59 original articles · Likes46 · Visits 30,000+

Guess you like

Origin blog.csdn.net/sinat_41852207/article/details/86742940