1 / 21

Object Oriented Programming

Object Oriented Programming. Dr. Ennis-Cole CECS 5100. Object Oriented Programming. Steps : 1.) Visual Design 2.) Code Writing. Object Oriented Programming . Controls toolbar, P. 23. OOP - Visual C++ . MFC Microsoft Foundation Class * Wizards to develop applications

minnie
Télécharger la présentation

Object Oriented Programming

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Object Oriented Programming Dr. Ennis-Cole CECS 5100

  2. Object Oriented Programming Steps: 1.) Visual Design 2.) Code Writing

  3. Object Oriented Programming Controls toolbar, P. 23

  4. OOP - Visual C++ MFC Microsoft Foundation Class * Wizards to develop applications * MFC AppWizard (dll) - generates source files and resource files

  5. OOP - Visual C++ MFC MFC AppWizard (exe) - larger exe files MFC Active X Control Wizard - creates starter files for plug-ins

  6. OOP Visual C++ MFC MFC Active X Control Wizard - multimedia, db, client server applications MFC ATL Wizard - Active Template Library - objects, controls

  7. OOP - Visual C++ Developer Studio - integrated tools for creating, testing, and refining applications. Complete development environment

  8. Popularity of Visual C++ A. Code Reusability B. Application Wizards (dlls, Active X, Atl Com Objects) C. Integrated development environment D. Components and Controls Gallery (reusable components & controls)

  9. Popularity of Visual C++ E. Support for MFC Library F. Portability G. Cross Platform support H. Availability in other languages I. Supports latest C++ features

  10. OOP - Visual C++ • Day 1: • Directory, Project, MFC AppWizard • Used pushbutton controls in a dialog box • Attached the (BN_CLICKED) event to the pushbutton • Classes Created: CHelloApp & CHelloDlg • Prefixes: Functions ON_WM; Messages WM_; Objects IDC_; Dialog Boxes IDD_

  11. Object Oriented Programming • OOP - a programming technique that relies on reusable software components that can be applied to different types of problems and applications. The programmer makes the machine work in terms of concepts closer to the user’s every day world. • Principle unit - An Object

  12. Objects • Separate Components : • Say Hello • Exit • Each had its own Caption & ID (IDC_…) • Belonged to the CHelloDlg Class • An instance of CHelloDlg Class • Created within the Visual Environment

  13. Objects • Private data ( ) • Procedures that could access that data • written in the CHelloDlg Class • Member functions: • OnSayhelloButton( ) • OnExitButton( ) • A program can be thought of as a collection of objects

  14. Objects • Messages • BN_CLICKED • BN_DOUBLECLICKED • Respond to predefined external stimuli • Mouse Click • Communication • Represent the events to which an object can respond

  15. Structure of a Function void reference, Class name ::, function name, ( ), {, Comments, Attached Code, Comments, }

  16. Classes • Case sensitivity • Properties Tables, P. 43 • Group Box, P. 52, Properties Table, P. 59 • Variables - storage containers: • Memory Location • Amount of Memory • m_TestEdit = “ ”; Num1 20 FFFA, 2bytes

  17. Variables - Changeable Quantities • An actual representation of a data type • Value Integer • CSTRING Character • BOOL Double, Float • Other Functions: • MessageBox(“ ”); • UpdateData(False); - updates screen w/new values

  18. New Windows Controls Edit Box, Check Box, Static, Group Box Right Click on on your mouse for property Settings Use P. 59 for your object’s properties Introduction of Keyboard Shortcuts

  19. Windows Programs • Calculator • Paint • Invoked via entries in the the Edit Box ab| (Calculator or Paint)

  20. Events • Linked with messages • After communication between objects, some action takes place. This action has the code in it to perform a set task - initialize a dialog box, paint, execute a system command.

  21. The End • “That’s all folks.”

More Related