Download presentation
Presentation is loading. Please wait.
Published byAleesha Warren Modified over 9 years ago
2
Object Oriented Programming Dr. Ennis-Cole CECS 5100
3
Object Oriented Programming Steps: 1.) Visual Design 2.) Code Writing
4
Object Oriented Programming Object Oriented Programming Controls toolbar, P. 23
5
OOP - Visual C++ MFC Microsoft Foundation Class * Wizards to develop applications * MFC AppWizard (dll) - generates source files and resource files
6
OOP - Visual C++ MFC MFC AppWizard (exe) - larger exe files MFC Active X Control Wizard - creates starter files for plug-ins
7
OOP Visual C++ MFC MFC Active X Control Wizard - multimedia, db, client server applications MFC ATL Wizard - Active Template Library - objects, controls
8
OOP - Visual C++ Developer Studio - integrated tools for creating, testing, and refining applications. Complete development environment
9
Popularity of Visual C++ A. Code Reusability B. Application Wizards (dlls, Active X, Atl Com Objects) B. Application Wizards (dlls, Active X, Atl Com Objects) C. Integrated development environment C. Integrated development environment D. Components and Controls Gallery D. Components and Controls Gallery (reusable components & controls) (reusable components & controls)
10
Popularity of Visual C++ E. Support for MFC Library F. Portability F. Portability G. Cross Platform support G. Cross Platform support H. Availability in other languages H. Availability in other languages I. Supports latest C++ features I. Supports latest C++ features
11
OOP - Visual C++ b Day 1: b Directory, Project, MFC AppWizard b Used pushbutton controls in a dialog box b Attached the (BN_CLICKED) event to the pushbutton b Classes Created: CHelloApp & CHelloDlg b Prefixes: Functions ON_WM; Messages WM_; Objects IDC_; Dialog Boxes IDD_
12
Object Oriented Programming Object Oriented Programming b 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. b Principle unit - An Object
13
Objects b Separate Components : Say HelloSay Hello Exit Exit Each had its own Caption & ID (IDC_…) Each had its own Caption & ID (IDC_…) b Belonged to the CHelloDlg Class b An instance of CHelloDlg Class b Created within the Visual Environment
14
Objects b Private data ( ) b Procedures that could access that data written in the CHelloDlg Classwritten in the CHelloDlg Class Member functions: Member functions: – OnSayhelloButton( ) –OnExitButton( ) b A program can be thought of as a collection of objects
15
Objects b Messages BN_CLICKEDBN_CLICKED BN_DOUBLECLICKEDBN_DOUBLECLICKED b Respond to predefined external stimuli Mouse ClickMouse Click b Communication Represent the events to which an object can respondRepresent the events to which an object can respond
16
Structure of a Function void reference, Class name ::, function name, ( ), {, Comments, Attached Code, Comments, }
17
Classes b Case sensitivity b Properties Tables, P. 43 b Group Box, P. 52, Properties Table, P. 59 b Variables - storage containers: Memory LocationMemory Location Amount of MemoryAmount of Memory m_TestEdit = “ ”;m_TestEdit = “ ”; 20 FFFA, 2 bytes Num1
18
Variables - Changeable Quantities b An actual representation of a data type ValueIntegerValueInteger CSTRINGCharacterCSTRINGCharacter BOOLDouble, FloatBOOLDouble, Float b Other Functions: MessageBox(“ ”);MessageBox(“ ”); UpdateData(False); - updates screen w/new valuesUpdateData(False); - updates screen w/new values
19
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
20
Windows Programs b Calculator b Paint b Invoked via entries in the the Edit Box ab| (Calculator or Paint)
21
Events b Linked with messages b 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.
22
The End The End b “That’s all folks.”
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.