Step 1
Step 1 :

This tutorial covers step-by-step the creation of a Pascal Windows project, as well as managing its options.

To create a new project, click on the File menu, then on "New project".

In the project type dialog, select "Windows application" and click OK to continue.

Step 2


Step 2
Step 2 :

Type a name for your project in the next dialog, like "Project 1" and click on OK.

You will have then to save your project in a directory. You can save it for example in c:\My Documents\ and then click on Save.

All the necessary files will be created in the directory you selected and your project will be opened in Dev-Pascal, with a new source file inside (the code inside it is the base for a win32 program).

Step 3


Step 3
Step 3 :

Now we are going to compile the project, and create a Windows executable.

Click on the Execute menu, and click on "Compile".

A dialog will ask you where do you want to save your file. Select a directory as well as a filename for your file and click on Save.

A windows titled "Compiling..." will appear. Dev-Pascal is currently compiling the file. If you don't get any compile errors, you can click on the Execute button to launch the executable of your program.

If any error occurs, it will be displayed in the Compiler output panel (at the bottom of Dev-Pascal).

You can then double-click on it to go to the error in your source.

Step 4


Step 4
Step 4 :

You can now do the following things with your project:

- Create a new file : click on Project menu, then "New unit in project"

- Add a file to your project : click on Project menu, then "Add unit to project"

- Remove a file from your project : right-click on the file you would like to remove in the Project Manager, and click on "Remove from project" (this can also be accessed by the Project menu)

- Set your project's main unit : this will tell the compiler which file needs to be compiled first (the one that will include all other files)

- Rename a file in your project : right-click on the file you would like to rename in the Project Manager, and click "Rename file"

- Set Project Options : follow Step 5

- Modify the resource file of your program : follow Step 6


Step 5
Step 5 :

Managing project options:

To open the Project Options dialog, click on the Project menu, then on "Project options".

Options are described here:

- Project icon : you can modify the default icon for your application, either by loading an existing   	icon from your hard disk (click on "Load Icon...", or either by selecting an icon in the Icon Library  (click on "Icon Library").

- Object files : Add object files to be linked with your project, as well as libraries and compiler options.

- Extra compiler options : You can add here compiler parameters that will be used when compiling.

- Extra include directories : You can specify here your project's include directories.

- Resource files : Add further resource file to your project

- Do not create a console : Check this if you are willing to make a Windows program, uncheck it if you want to create a console (DOS window) program.

- Create a DLL : Check this is you want to create a DLL instead of an EXE file. You also need to replace the 'program' keyword from your main file to 'library'

Step 6


Step 6
Step 6 :

Modifying the resource file:

To open the Resource Editor, click on the Project menu, then on "Edit resource file".

Then, you will be able to modify your resource file. The Resource Editor can also easily add menus, bitmaps, fonts and icons to your resource file, by clicking on the appropriate buttons in the  dialog.

When creating menus, you should take a look at the WinMenu example included

with Dev-Pascal to know how to set the menu in your program.