0% found this document useful (0 votes)
16 views9 pages

Visual Studio C++ Project Tutorial

This document provides a tutorial on developing a simple C++ program in Microsoft Visual Studio .NET 2003. It describes: 1) Creating a new solution and project called "SimpleMediaPlayer" 2) Adding a C++ source file called "SimpleMediaPlayer.cpp" 3) Writing code in the source file to build the program 4) Building the program using the "Build" menu which compiles the code 5) Executing the built program using the "Debug" menu to see the output

Uploaded by

Muzamil
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views9 pages

Visual Studio C++ Project Tutorial

This document provides a tutorial on developing a simple C++ program in Microsoft Visual Studio .NET 2003. It describes: 1) Creating a new solution and project called "SimpleMediaPlayer" 2) Adding a C++ source file called "SimpleMediaPlayer.cpp" 3) Writing code in the source file to build the program 4) Building the program using the "Build" menu which compiles the code 5) Executing the built program using the "Debug" menu to see the output

Uploaded by

Muzamil
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

C++ Development Methods [Link]

com

MICROSOFT VISUAL STUDIO C++ .NET 2003: DEVELOPING A SIMPLE PROGRAM

This tutorial is meant to serve as a step-by-step walkthrough of the process of developing projects – including creat-
ing/opening, building, and executing – in the Microsoft Visual Studio C++ .NET 2003 Integrated Development En-
vironment (IDE).

Part I: Creating a New C++ Project

1. To open Microsoft Visual Studio C++ .NET 2003, double-click on the Visual Studio C++ .NET 2003 icon
located on the desktop. Alternatively, you may use the Start menu found at the bottom left corner of the
computer desktop – Start >> Programs >> Microsoft Visual Studio .NET 2003 >> Microsoft Visual
Studio .NET 2003.

MMMuzammil for ictsociety


Page 1 of 9
C++ Development Methods [Link]

2. Once the IDE opens successfully, use your mouse to traverse the File menu. Click File >> New >> Blank
Solution ….

[Link] the New Project dialog box that appears, type “SimpleMediaPlayer” adjacent to Name: and choose the appro-
priate location (recommendation: “C:\cs201\vsprojects\lab00\prelab\SimpleMediaPlayer”). You may use the
Browse … button, as necessary. Click OK.

MMMuzammil for ictsociety


Page 2 of 9
C++ Development Methods [Link]

3. On the right side of the IDE, you now see a Solution Explorer window. Contained within it is “Solution
‘SimpleMediaPlayer’ (0 projects).” (If this does not appear, simply click on View >> Solution Explorer.)

[Link] the mouse, right-click on “Solution ‘SimpleMediaPlayer’ (0 projects)” within the Solution Explorer win-
dow. A menu pops up. Choose Add >> New Project …. Note: The Existing Project option is also available; this
selection will be of use later.

[Link] Visual C++ Projects >> Win32 within the Project Types frame of the dialog box that appears. Select
Win32 Console project. Provide a name for the project (“SimpleMediaPlayer”) and location (the software will
default to “C:\cs201\vsprojects\lab0\prelab\SimpleMediaPlayer\SimpleMediaPlayer,” once you have specified the
project name). Click OK.

MMMuzammil for ictsociety


Page 3 of 9
C++ Development Methods [Link]

4. In the Win32 Application Wizard – SimpleMediaPlayer box that appears, select Application Settings.
Keep the Application Type as “Console Application”; select “Empty Project” under Additional Options
by clicking on the checkbox adjacent to it. Click Finish.

5. The number of projects associated with the solution should now be updated to reflect the addition of the
SimpleMediaPlayer project. You should now see a SimpleMediaPlayer project display beneath “Solu-
tion ‘SimpleMediaPlayer’ (1 project)” that includes folders for source, header, and resource files.
Part II: Creating a New C++ Source File

1. Now it is time to create a new C++ source file. Begin by right-clicking upon “SimpleMediaPlayer” in the
Solution Explorer – SimpleMediaPlayer window. A menu appears. For now, select Add >> Add New
Item …. Note: Alternatively, you may create a new file by going to File >> New >> File …, selecting the
appropriate category (e.g., “Visual C++”), and then the provided template (e.g., “C++ File (.cpp)”) and
then adding that file by right-clicking upon SimpleMediaPlayer within the Solution Explorer – Simple-
MediaPlayer >> Add >> Add Existing Item….

MMMuzammil for ictsociety


Page 4 of 9
C++ Development Methods [Link]

Leave the Visual C++ option selected in the dialog box that appears. Choose “C++ File (.cpp).” Provide a name
and location for the new file in the appropriate fields – “[Link]” and
“C:\cs201\vsprojects\lab00\prelab\SimpleMediaPlayer\SimpleMediaPlayer\”). Click Open. Note: You may also
add other files in a similar fashion; this process will become necessary beginning in the next laboratory assignment.

MMMuzammil for ictsociety


Page 5 of 9
C++ Development Methods [Link]

2. Now double-click upon the “[Link]” file that appears inside the “Source Files” directory
located under the Solution Explorer – SimpleMediaPlayer window. You are now ready to begin coding
your first software system in the Microsoft Visual Studio C++ .NET 2003 IDE. Use the requirements
specification provided in the pre-laboratory section of the laboratory assignment to proceed.

Part III: Building and Executing

As you write code, it is good software design methodology to use the divide and conquer approach outlined in the
laboratory assignment. In order to do this, you will need to know how to build and execute your software. This
section of this walkthrough aims to show you precisely how to do that.

Note: For this section, the screenshots that appear in this walkthrough will be of a simple “Hello World” program.
However, on your screen, ensure that you have much different code, since you will be completing the assignment
specified in the pre-laboratory section of the laboratory assignment.

1. Before writing your code, make sure you have the following header information included at the top of your
[Link] file: (a) the course number and name; (b) the laboratory number and title; (c) your
name; (d) your laboratory section; and (e) the date. You must follow this protocol on all your code docu-
ments throughout this semester.

MMMuzammil for ictsociety


Page 6 of 9
C++ Development Methods [Link]

2. Now, to build your software system in Microsoft Visual Studio C++ .NET 2003, use the Build menu:
Build >> Build Solution. Alternatively, you may also use shortcut keys, specifically Ctrl + Shift + B.

MMMuzammil for ictsociety


Page 7 of 9
C++ Development Methods [Link]

3. An Output window, with Build information, and the corresponding Task List, will appear. Note: If er-
rors exist in your source code, you will see that the build failed in the Output window. Error messages
will appear in the Task List.

Once you have successfully built your software system and no errors exist, you can execute your software by using
options in the Debug menu. You may execute the program without debugging – Debug >> Start Without Debug-
ging (alternatively, Ctrl + F5 – or, as you will see during the in-laboratory exercises, with the Visual Studio Debug-
ger enabled – Debug >> Start (alternatively, F5).

MMMuzammil for ictsociety


Page 8 of 9
C++ Development Methods [Link]

Starting without debugging will pop-up the Win32 console application, with the output of the program.

MMMuzammil for ictsociety


Page 9 of 9

Common questions

Powered by AI

To start developing a new C++ project, open Microsoft Visual Studio C++ .NET 2003 by double-clicking the Visual Studio C++ .NET 2003 icon on the desktop or accessing it via the Start menu under Programs .

To add a new C++ source file, right-click on the project in the Solution Explorer, select 'Add' then 'Add New Item', choose 'C++ File (.cpp)', provide a name and location, and click 'Open' .

To build a software system, select 'Build' then 'Build Solution' from the Build menu. Building failures are indicated in the Output window and by error messages in the Task List when errors exist in the source code .

The Win32 Application Wizard helps set up a new project by allowing the selection of application settings like the application type (e.g., Console Application) and additional options such as creating an 'Empty Project' .

Execute the program without debugging by selecting 'Debug >> Start Without Debugging' or using Ctrl + F5. To enable the Visual Studio Debugger, select 'Debug >> Start' or use F5 .

The header information should include (a) the course number and name, (b) the laboratory number and title, (c) your name, (d) your laboratory section, and (e) the date .

The Solution Explorer displays the structure of the solution, showing the projects and associated folders. It assists in organizing, accessing, and managing the files and resources in a project .

Proper naming conventions and file organization facilitate project management, ensure consistency, and prevent errors during development. They enable easier navigation and maintenance of the codebase, which is critical in a collaborative or educational setting .

To add a new project to a solution, right-click on the solution in the Solution Explorer, choose 'Add' then 'New Project', select 'Visual C++ Projects', pick 'Win32', and then 'Win32 Console project'. Name the project and specify the location before clicking 'OK' .

The 'divide and conquer' approach is recommended to manage complex software development by breaking down the system into manageable components, allowing for focus on individual parts which can be developed and tested independently .

You might also like