Creating a Project

A program contains source files and libraries. The source files are compiled into object files and then linked with the libraries to create a program. In Windows programs you need to link additional files such as resource files (files that contain icons, menus, dialog boxes) and module-definition files (files that contain information about the Windows program). For an illustration of this process, see Figure 3.1.

Before you create a program, you need to create a project for it. A project can consist of only one source file or of many source, resource, and library files.

To familiarize yourself with the steps in building a project, you can use the FIRST program to create a single file project or the files listed below to create a multifile project.

Files Directory  
GENERIC.C GENERIC.DEF GENERIC.H GENERIC.RC SOURCE\GENERIC  

The directory listed above is the default directory created by SETUP. If you changed the default directory names, the location of the required files will be different.

·To create a project:

1.From the Project menu, choose Open. The Open Project dialog box appears.

2.Type the filename in the File Name text box and choose OK. All project files have a .MAK extension.

3.A message box will tell you that the project doesn't exist. Choose the Yes button to create the project. The Edit Project dialog box appears (see Figure 3.2).

4.Enter the type of files to choose in the List Files of Type text box. The text box lets you specify a pattern for selecting files. To display all files, type *.* and press ENTER. All files in the current directory are shown in the file list. The drop-down box displays a list of common file extensions.

5.To add a file to the project, double-click the file and then choose the Add button.

6.Choose the OK button to save the project.

The project is now ready to build. If you want to skip ahead and create a program, see Chapter 4, “Building and Running Programs.”

NOTE:

If your program consists of only one file, you can build and run it without creating a project. However, if another project is loaded or the Graphical Development Environment is restarted, all compiler and linker options for the program must be reentered. These settings are retained if you use a project.