Visual Studio C + + programming learns build events in Visual Studio

Source: Internet
Author: User
Tags bmp image

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

Related Article

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.