Showing posts with label Chapter6. Show all posts
Showing posts with label Chapter6. Show all posts

Wednesday, February 20, 2008

STEPS TO CREATE AND EXECUTE A NEW PROGRAM

STEPS TO CREATE AND EXECUTE A NEW PROGRAM :

The steps consists of four steps

* Creating a source file
* Compiling the source file or creating an .obj file
* Building or linking or creating an exe file.
* Executing the exe file.


CREATING A SOURCE FILE:

* Click on the Start and select Programs and then select the option VC++.

* As soon as new window opens Click on the FILE option and click on theNEW option.

* Select the PROJECTS tab and select Win32 Application and enter a project name.

* Click on ok.
* Click on the FILE option and click on the NEW option.
* Select the FILE tab and Click the option TEXT FILE, then enter the file name and click on ok.
* Save the .txt file with an extension of .c
* Right click on the file and select on the option insert file into project and click the project name.
* Write down the code and save it.

CREATING RESOURCES :

CREATING RESOURCES :

DEFINITION OF RESOURCE:

Resources are designed to use and also made reusable by different applications .By their definition they are used by the program but not created programmatically.

I f multiple instances of an application are loaded in memory, windows doesn’t load the resources multiple time it instead loads the resources when first instance is initiated and simply maps a view to the resource into other instances.

TYPES OF RESOURCES:

DATA TYPE MEANING

MENU defines the menu structure for a program

ACCERELATOR Defines the keyboard shortcuts for the menu items that can used instead of mouse.
BITMAP Is a picture defining larger images.

CURSOR is a picture defining data, which defines the types of mouse cursor shapes.

DIALOG BOX Defines the layout of components like buttons, radio buttons etc.

FONT Are data defining characters.

ICON is a picture defining small images.

STRING TABLE IS a table of character strings that is used for messages used within the program.

STEPS TO CREATE A RESOURCE:

STEPS TO CREATE A RESOURCE:

Select the option INSERT from the menu bar. From the menu that is displayed choose the
Option RESOURCE .The INSERT RESOURCE dialog box is displayed.

Select the option MENU and click on OK button.

Then a grey bar is displayed with a small portion highlighted, Right click on that portion
And enter the caption and ID for tat menu item

Repeat the same process till the menu items are created.

Click on the FILE and choose SAVE AS option, and save the file as script.rc file and
Resource.h gets created automatically.

NOTE: This Resource.h is a header file, which has all the definitions of all the resources.
SCRIPT.RC file requires this file to compile itself.

Include the SCRIPT.RC file into our project by clicking on the option PROJECT, and
Then choose ADD TO PROJECT option then choose FILES, select the script file which
Is supposed to be inserted into the project.