Google Ads

Thursday, December 3, 2009

PROGRAMMING MODEL

WINDOWS PROGRAMMING MODEL



Message processing:


 When writing MS – DOS program the only required function is main.

 When windows operating system launches a program, it calls WinMain function.

 Its task is to create the application’s main window which has its own code to process messages that windows sends to it.

 Windows based program processes user input via messages from the operating system.

 For example
 WM_CREATE message is sent when a window is being created.
 WM_LBUTTONDOWN message is sent when the user presses the left mouse button.
 WM_CHAR message is sent when the user types a character.
 WM_CLOSE message is sent when the user closes the window.

Windows Graphics Device Interface:

 Windows provides a layer of abstraction called graphics device interface.

 Instead of addressing the hardware, program calls the GDI functions that reference a data structure called a device context.

 Windows maps the device context structure to a physical device and issues appropriate input / output instructions.

Resource Based Programming:

 In windows the data is stored in a resource file using a number of established format.

 The linker combines the binary resource file with the C++ compiler’s output to generate an executable program.

 Resource files can include bitmaps, icons, menu definitions, dialog based layouts and strings.

Dynamic Link Libraries:

 Windows allows dynamic linking, means that specially constructed libraries can be loaded and linked at runtime.

 Multiple applications can share dynamic link libraries which saves memory and disk space.

 DLL increases program modularity – since it can be compiled and tested separately.

AppWizard:

 Is a code generator that creates a workspace frame of a windows application with features, class names and source code file names.

ClassWizard:

 Is a program that’s accessible from visual C++ view menu.





Application Framework:

 Is an integrated collection of object oriented software components that offers all that needed for a generic application.

 It defines the structure of the program.

 By convention, MFC library class names begin with the letter C.

View:
 A view is an ordinary window that the user can size, move and close in the same way as any other windows – based application window.
 From the programmer’s angle, a view is a C++ object of a class derived from the MFC library CView class.

Single Document Interface (SDI):
 An SDI application has only one window, only one document can be loaded at a time. Notepad is an example for single document interface.

Multiple Document Interface (MDI):
 An MDI application has multiple child windows, each corresponds to an individual document. Microsoft word is an example for MDI.

No comments:

Post a Comment