Download presentation
Presentation is loading. Please wait.
Published byClement Simon Modified over 9 years ago
1
Windows Programming, C.-S. Shieh, KUAS EC, 20051 Chapter 0 Overview
2
Windows Programming, C.-S. Shieh, KUAS EC, 20052 Computer Programming What is programming? –Computers are quick, reliable, and flexible. –The flexibility of computers is a result of the idea "stored-program control". –We instruct computer to perform tasks via programming - the writing of computer control programs. –Windows programming is the writing of computer programs running within Windows environments.
3
Windows Programming, C.-S. Shieh, KUAS EC, 20053 Computer Programming (cont) Programming paradigms –Hardwired control, in contrast to flexible stored- program control –Machine code –Assembly language –High-level language –Macro of packages, extensions to designed functionality to fit customer's need –Script of operating systems, such as batch files, shell script,... –Script of virtual machines, such as Netscape Navigator and Microsoft Internet Explorer are virtual machine for JavaScript.
4
Windows Programming, C.-S. Shieh, KUAS EC, 20054 Computer Programming (cont) Language translators –Assembler –Compiler –Interpreter –Virtual machines
5
Windows Programming, C.-S. Shieh, KUAS EC, 20055 Computer Programming (cont) High-level programming languages –Procedural FOrmula TRANslator (FORTRAN) Beginner's All-purpose Symbolic Instruction Code (BASIC) COmmon Business Oriented Language (COBOL) Pascal C –Functional PROgramming in LOGic (PROLOG) –Object-oriented Object Pascal C++ –…
6
Windows Programming, C.-S. Shieh, KUAS EC, 20056 Object-Oriented Programming Encapsulation of data and related operators class rectangular { public: int width; int height; int area() { return width*height; } }; int main() { rectangular x; x.width=5; x.height=6; printf("%d",x.area()); }
7
Windows Programming, C.-S. Shieh, KUAS EC, 20057 Object-Oriented Programming (cont) Inheritance class rectangular { public: int width; int height; int area() { return width*height; } }; class block: public rectangular { public: int depth; int volume() { return width*height*depth; } }; int main(int argc, char **argv) { block x; x.width=5; x.height=6; x.depth=2; printf("%d",x.volume()); }
8
Windows Programming, C.-S. Shieh, KUAS EC, 20058 Windows Programming Why Windows? –PCs make computers more affordable. –Graphic User Interface (GUI) of Windows make computers more user-friendly.
9
Windows Programming, C.-S. Shieh, KUAS EC, 20059 Windows Programming (cont) Paradigms for Windows programming –Windows Application Programming Interface ( ~ machine code) A huge collection of C functions for drawing graphic user interfaces and tracking Windows messages. –Application Framework ( ~ assembly language) Hierarchical class library and hidden message-handling mechanism to reduce the burden of programmers. Microsoft's Microsoft Foundation Class (MFC) Borland's Object Windows Library (OWL) –Rapid Application Development (RAD) / Visual Programming ( ~ high-level language) Visual components greatly simply the GUI deign. Adopt the concept of software IC. Microsoft's Visual BASIC in BASIC Borland's Delphi in Object Pascal Borland's C++ Builder in C++
10
Windows Programming, C.-S. Shieh, KUAS EC, 200510 Windows Programming (cont) Program execution from programmer's viewpoint –DOS programs are procedural with console I/O: Program starts execution with main(), functions (procedures) are called in turn at the will of programmers. –Windows programs are event-driven with GUI: Graphic user interface is presented, and then functions are called in response to user's action.
11
Windows Programming, C.-S. Shieh, KUAS EC, 200511 Windows Programming (cont) Program design from programmer's viewpoint –DOS programming declare required variables implement procedural algorithms –Windows programming graphic user interface design choose visual components set up their prosperities implement event handlers
12
Windows Programming, C.-S. Shieh, KUAS EC, 200512 Borland C++ Builder Borland Software Corporation at http://www.borland.com GUI design is greatly simplified with visual drag-and-drop of components. An excellent implementation of the idea of software IC. Each software component has –Properties: can be set at design time or modified by code at run time to change its behavior or appearance. –Methods: callable functions for performing certain functions –Responsive events: where we implement our algorithms Intensive on-line will help you to get acquainted with those components. Wide variety of third-party components are available from third party, even free on the Internet.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.