Using Visual Studio 2015 (VS)



Appendix A - 2015Using Visual Studio 2015 (VS)As previously mentioned, VS is also referred to as an Integrated Development Environment (IDE XE "IDE" ). The material presented here is simply designed to help get you started using this very powerful and professional tool. Before we get too far, please keep in mind to relax and have fun with this package. Remember, any time you spend learning how to use this application will be well spent. The following illustrations were done using Microsoft Visual Studio 2015 Professional Edition.Getting startedLaunch Visual Studio. The process will depend upon the version of Windows you are running.497840482600Figure A.1 New project window00Figure A.1 New project windowSelect File -> New -> Project -> and click on the arrow to the left of Visual C++ Projects (under Templates). The results are shown in Figure A.1.On the left hand side under Templates, select Win32. In the center section, select Win32 Console Application. Enter the name of your new project in the Name field. For illustrative purposes we have called our project ‘Sample1’. Click the OK button. Figure A.2 shows the window that is now displayed.468118559Figure A.2 Win32 application wizard0Figure A.2 Win32 application wizard5168903491230Figure A.3 Application settings00Figure A.3 Application settingsYou will now see the Win32 Application Wizard. On the left side you will find the link called Application Settings. Under Application Settings / Additional Options you need to check the box that says Empty project. Make it a point to also verify that the Console Application radio button has been selected for you. This is illustrated in Figure A.3.Click the Finish button. We now have created a Solution. As you may recall, a solution is comprised of one or more projects (i.e., applications).center625475Figure A.4 New file window00Figure A.4 New file windowUnder File -> select New -> File. A new file dialog box will appear as shown in Figure A.4.Under Installed be sure to click on Visual C++ and in the center section select C++ File (.cpp) as shown in Figure A.4. Now press the Open button.498181620243Figure A.5 Visual Studio with Sample1.cpp00Figure A.5 Visual Studio with Sample1.cppBy default, the name of your new file is called Source1.cpp. Immediately save this file to the same directory as your solution but give it a new name as we did, Sample1.cpp. Visual Studio should now appear as shown in Figure A.5.right474Figure A.6 Including source file00Figure A.6 Including source fileNow go to the File menu option and select the Move Sample1.cpp into -> Sample1 project. This is directly above the Exit menu option at the bottom of that menu. The menu system is shown in Figure A.6.You are now in the editor and the file Sample1.cpp has been added to this project.Type in the program as shown in Figure A.7. Notice the use of the colored text in relation to the syntax highlighting. Your code should look something similar to Figure A.7.365760127635Figure A.7 Unsaved source code00Figure A.7 Unsaved source codeNotice an asterisk appears to the right of the filename indicating the file has not yet been saved.Under the Debug menu option, select Start without Debugging.You may see the dialog box below appears and notes that Visual Studio is working on your behalf to monitor the change state of your application. If indeed you have made changes, you will be asked if you would like to ‘build’ your application – click the Yes button. This is shown in Figure A.8.406400104140Figure A.8 Project out of date confirmation window00Figure A.8 Project out of date confirmation windowNotice once you have started the build process the Output window at the bottom of Visual Studio is providing status information. The Output window is shown in Figure A.9. 4707910Figure A.9 Output window00Figure A.9 Output window5048252445385Figure A.10 Console window0Figure A.10 Console windowAs you can see your application has launched a new console application and displays the text “Hello World” as shown below. Remember, to terminate the console application you need to press any key. The console window is shown in Figure A.10.Congratulations! You have now just entered in, compiled, built and executed your first C++ program! ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download