Perhaps is too convenient, everyone in VisualStudio debugging code, mostly used to direct point this small green arrow, but in fact from the point of this little Green Arrow until the program began to run through the middle of a number of steps.
Let me tell you some of my experience about the issues that I have encountered during the compilation process in this episode.
Let's start with today. Build events in Visual Studio
One example: Several BMP image data files are placed in test. vcproj The Files folder under the folder where the project is located. At this point, the outside world calls the DLL file generated by the project and needs to take the BMP image data file in the Data folder.
As shown in the following:
As the first boot entry, the calltest needs to read the image in the Data folder below test.
Of course, in this case, we can do it manually, copy those images to the outside of the project folder, or you can write the path to the data in the external code where the image needs to be read. But if the computer is able to do it automatically, why do we still have the labor?
See:
There are pre-build, pre-link, post-build event three in the build event under Project properties, configuration properties, pre-build, and post-build for the above requirements: at the command line, you can go to Xcopy. \data\*.bmp. \outfolder\data. The front is., which represents the folder under which test. Vcproj is located; The following is: Represents the folder on which the test. Vcproj is located. It is also necessary to note that the backslash \.
Compile by:
The *.bmp image file was successfully copied to the specified location.
Also, attach the use of Xcopy to this DOS command:
DOS is very powerful, comrades need to work hard!
By the end, copying a file is just a simple application for generating events, and it can also be used to write some other scripts, see:
http://blog.163.com/[email protected]/blog/static/109412748201332402929279/
Http://blog.sina.com.cn/s/blog_752ca76a010181ma.html
http://msdn.microsoft.com/zh-cn/library/aa833213 (v=vs.100). aspx
Visual Studio C + + programming learns build events in Visual Studio