Visual C++: Adding a New Header (.h) File to a Project (2008)

Adding a New Header (.h) File to a Project (2008)

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

  1. Begin by left-clicking the "Header Files" folder in the "Solution Explorer" pane on the left.
  2. Then in the menubar, left-click "Project" and "Add New Item" in the submenu.

  3. This opens the "Add New Item" dialog. Left-click "Visual C++" in the "Categories:" Pane and then "Header File (.h)" in the "Templates:" pane.
  4. Then left-click the "Name:" box and type in the name of the header file. In this example, we are assuming that the header is for a class named CMyClass. So, the file name is "CMyClass.h" as shown. To finish the dialog, left-click the "Add" button.

  5. The header 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.