Visual C++: Adding a New Source (.cpp) File to a Project (2008)

Adding a New Source (.cpp) File to a Project (2008)

This video shows how to add a source (.cpp) file to an existing project. Assuming that you have a project open, you can follow these instructions:

Begin by left-clicking the "Header Files" folder in the "Solution Explorer" pane on the left.

Then in the menubar, left-click "Project" and "Add New Item" in the submenu.

This opens the "Add New Item" dialog. Left-click "Visual C++" in the "Categories:" Pane and then "C++ File (.cpp)" in the "Templates:" pane.

Then left-click the "Name:" box and type in the name of the source file. In this example, we are assuming that the source is for a class named CMyClass. So, the file name is "CMyClass.cpp" as shown. To finish the dialog, left-click the "Add" button.

The source file has now been added to the project and you should see it there. The file is actually located in the your project folder on your hard drive. If you open your project folder, you will see the new file there, as shown above.