Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

Borland C++ Builder

Introduction C++ Builder can be used to create 32-bit Windows applications ranging from general-purpose utilities to sophisticated data access programs. When you start C++ Builder, you are placed within the object-orientated integrated development environment, the IDE. This environment provides all the tools you need to design, develop, test, debug, and deploy applications. To launch the IDE for C++ Builder, choose Programming from the Public menu on the Windows taskbar then choose C++ Builder5 from the ++ Builder option:

Starting The IDE

The initial screen should appear like this:

Across the top of the window is the title bar with the minimise, maximise and close buttons on the right-hand side. Under the title bar are ten menus. The Menus The File, Edit and Search menus have all the usual Windows options, whilst the other menus contain options specific to the C++ Builder environment. The View menu allows you to view a number of windows containing program and environment information.

Borland C++ Builder

The Project menu is for the manipulation of project files and control of all aspects of a project, allowing you to compile all or part of a program. The Run menu provides facilities testing and debugging the application. The Component menu allows for defining, specification and insertion of external objects into the application. The Database menu provides ways of interacting with several types of live database. The Tools menu allows you to run other programs, tools and utilities useful in the development of Windows applications, without leaving the IDE. The Help menu gives you access to on-line help including tutorials, programming syntax, examples and library information. The Button Bars Below the menu bar to the left is a block of buttons that represent commonly performed tasks:

Pointing to a button will display its function. The Component Palette To the right of the button bars is the Component Palette:

Each tab in the Component Palette displays a group of icons representing the components you can use to design your application interface such as menus, buttons and dialogue boxes. These are the building blocks of every application. The Form The main part of the IDE screen is taken up by a blank form on which you will create the user interface and other parts of your application by placing components on it. The default form has Maximise and Minimise buttons, a Close button, and a Control menu. If you run the form now by pressing F9, you'll see that these buttons all work. (To return to design mode, click the X to close the form.) The Object Inspector To the left of the Form is the Object Inspector. This is the connection between your application's visual appearance and the code that makes your application run. The object selector at the top of the Object Inspector is a dropdown list containing all the components that you have placed on the active form and it also displays the object type of the selected component. This lets you quickly display properties and events for the different components on the current form. The Object Inspector has two sections, the Properties page and the Events page with tabs provided as a means of switching between them.

Borland C++ Builder

Creating And Running a Program

Before beginning a new application, you should create a folder to hold the source files. Each application is represented by a project. When you start C++ Builder, it creates a blank project by default. If another project is already open, choose New Application from the File menu to create a new project. A new project, automatically contains the following files: Project1.cpp - a source-code file associated with the project. Unit1.cpp - a source-code file associated with the main project form. This is called a unit file. Unit1.h - a header file associated with the main project form. This is called a unit header file. Unit1.dfm - a resource file that stores information about the main project form. This is called a form file. Each form has its own unit, header, and form files. If you create a second form, a second unit (Unit2.cpp), header ( Unit2.h), and form (Unit2.dfm) file are automatically created. You should save these files to the folder you have just created by choosing Save All from the File menu. When the Save dialogue appears: Navigate to your project folder. Save Unit1 using the default name Unit1.pas. Save the project using appname.bpr. Where appname is a name of your choice.

Adding Components

You are now ready to add components to the form and to associate actions and properties to them. Use the Help menu, which contains tutorial assistance, to take you through creating a simple application. You should periodically resave your work by choosing Save All from the File menu. When you save your project, C++ Builder creates additional files in your project directory. These files include: appname.bpr which is the project options or makefile, appname.res which is the Windows resource file. You do not need to worry about these files but do not delete them. The executable file for your application will be named the same as the project name with an exe extension.

Saving The Project

Compiling And Testing Deploying Applications

To compile and test your application at any time, choose Run from the Run menu. Once an application is up and running, you need to make it available for others. A number of steps must be taken to deploy an application to another computer so that the application is completely functional. The steps required vary, depending on the type of application. It may require a number of supporting files such as DLLs or helper applications. It may also require changes to be made to the receiving computer's Windows registry. Consult the C++

Borland C++ Builder

Builder Help section under the Help menu for details of how to prepare your application for installation to other computers. Ending C++ Builder To end your session in the C++ Builder IDE, choose Exit from the File menu.

Borland C++ Builder

You might also like