Windows Programming Using MFC and Visual C€¦ · Introduction to Windows Programming Using MFC...
Transcript of Windows Programming Using MFC and Visual C€¦ · Introduction to Windows Programming Using MFC...
![Page 1: Windows Programming Using MFC and Visual C€¦ · Introduction to Windows Programming Using MFC and Visual C ++.Net Introduction 7 COURSE OVERVIEW Introduction to Visual Studio Projects](https://reader034.fdocuments.us/reader034/viewer/2022042515/5f76b5e04c58c73a1c5b5a51/html5/thumbnails/1.jpg)
Masoud Milani
School of Computer Science
Florida International University
Miami, FL 33199 [email protected]
Windows Programming Using MFC and
Visual C++ .Net
Introduction
![Page 2: Windows Programming Using MFC and Visual C€¦ · Introduction to Windows Programming Using MFC and Visual C ++.Net Introduction 7 COURSE OVERVIEW Introduction to Visual Studio Projects](https://reader034.fdocuments.us/reader034/viewer/2022042515/5f76b5e04c58c73a1c5b5a51/html5/thumbnails/2.jpg)
Introduction to Windows Programming Using MFC and Visual C++ .Net Introduction 2
INTRODUCTION
� This course covers the fundamental concepts and techniques necessary to
write Windows-based interactive
programs
� We will use the Visual Studio, Visual
C++ .Net and Microsoft Foundation Classes to discuss the above concepts
![Page 3: Windows Programming Using MFC and Visual C€¦ · Introduction to Windows Programming Using MFC and Visual C ++.Net Introduction 7 COURSE OVERVIEW Introduction to Visual Studio Projects](https://reader034.fdocuments.us/reader034/viewer/2022042515/5f76b5e04c58c73a1c5b5a51/html5/thumbnails/3.jpg)
Introduction to Windows Programming Using MFC and Visual C++ .Net Introduction 3
INTRODUCTION
� Contents:
� Events and Event Handling
� Windows, Dialogs and Controls
� Menus and Toolbars
� Application Organization
� Document/View Architecture
� Printing and Print Preview
� Multi-Threaded Programming
![Page 4: Windows Programming Using MFC and Visual C€¦ · Introduction to Windows Programming Using MFC and Visual C ++.Net Introduction 7 COURSE OVERVIEW Introduction to Visual Studio Projects](https://reader034.fdocuments.us/reader034/viewer/2022042515/5f76b5e04c58c73a1c5b5a51/html5/thumbnails/4.jpg)
Introduction to Windows Programming Using MFC and Visual C++ .Net Introduction 4
REQUIREMENTS
� Working knowledge of C++
including:
� Classes
� Inheritance
� Virtual functions
� Late binding
� Template classes
![Page 5: Windows Programming Using MFC and Visual C€¦ · Introduction to Windows Programming Using MFC and Visual C ++.Net Introduction 7 COURSE OVERVIEW Introduction to Visual Studio Projects](https://reader034.fdocuments.us/reader034/viewer/2022042515/5f76b5e04c58c73a1c5b5a51/html5/thumbnails/5.jpg)
Introduction to Windows Programming Using MFC and Visual C++ .Net Introduction 5
COURSE RESOURCES
� Web address:
http://www.cs.fiu.edu/~milani/cop4226
Here you will find class notes, class presentations, assignments, class bulletin board, various announcements and dates and more
� Text Book:
I am not using any particular text book. There will be plenty of reading material on the course web site and MSDN libraries have an extensive set of online manuals
![Page 6: Windows Programming Using MFC and Visual C€¦ · Introduction to Windows Programming Using MFC and Visual C ++.Net Introduction 7 COURSE OVERVIEW Introduction to Visual Studio Projects](https://reader034.fdocuments.us/reader034/viewer/2022042515/5f76b5e04c58c73a1c5b5a51/html5/thumbnails/6.jpg)
Introduction to Windows Programming Using MFC and Visual C++ .Net Introduction 6
GRADING
� Exam1 30%
� Exam2 30%
� Programming and Homework
Assignments 40%
� 2-3 programs
![Page 7: Windows Programming Using MFC and Visual C€¦ · Introduction to Windows Programming Using MFC and Visual C ++.Net Introduction 7 COURSE OVERVIEW Introduction to Visual Studio Projects](https://reader034.fdocuments.us/reader034/viewer/2022042515/5f76b5e04c58c73a1c5b5a51/html5/thumbnails/7.jpg)
Introduction to Windows Programming Using MFC and Visual C++ .Net Introduction 7
COURSE OVERVIEW
� Introduction to Visual Studio
� Projects
� Views
� Wizards
� Different Application Types
� Resources
� Editors
� MSDN Library
![Page 8: Windows Programming Using MFC and Visual C€¦ · Introduction to Windows Programming Using MFC and Visual C ++.Net Introduction 7 COURSE OVERVIEW Introduction to Visual Studio Projects](https://reader034.fdocuments.us/reader034/viewer/2022042515/5f76b5e04c58c73a1c5b5a51/html5/thumbnails/8.jpg)
Introduction to Windows Programming Using MFC and Visual C++ .Net Introduction 8
COURSE OVERVIEW
� Introduction to Windows
� Kernel
� GDI
� User
� Window Classes
� Events and Messages
� Message Loop
� Window Procedures
![Page 9: Windows Programming Using MFC and Visual C€¦ · Introduction to Windows Programming Using MFC and Visual C ++.Net Introduction 7 COURSE OVERVIEW Introduction to Visual Studio Projects](https://reader034.fdocuments.us/reader034/viewer/2022042515/5f76b5e04c58c73a1c5b5a51/html5/thumbnails/9.jpg)
Introduction to Windows Programming Using MFC and Visual C++ .Net Introduction 9
COURSE OVERVIEW
� Microsoft Foundation Classes
� Message Boxes
� Controls
� Push Buttons
� Radio Buttons
� Check Boxes
� Slider Controls
� …
� Data Exchange
� Control States
![Page 10: Windows Programming Using MFC and Visual C€¦ · Introduction to Windows Programming Using MFC and Visual C ++.Net Introduction 7 COURSE OVERVIEW Introduction to Visual Studio Projects](https://reader034.fdocuments.us/reader034/viewer/2022042515/5f76b5e04c58c73a1c5b5a51/html5/thumbnails/10.jpg)
Introduction to Windows Programming Using MFC and Visual C++ .Net Introduction 10
COURSE OVERVIEW
� Multi Document Applications
� Application
� ChildFrame
� MainFrame
� Document
� View
� Menus
� Toolbars, Tooltips
![Page 11: Windows Programming Using MFC and Visual C€¦ · Introduction to Windows Programming Using MFC and Visual C ++.Net Introduction 7 COURSE OVERVIEW Introduction to Visual Studio Projects](https://reader034.fdocuments.us/reader034/viewer/2022042515/5f76b5e04c58c73a1c5b5a51/html5/thumbnails/11.jpg)
Introduction to Windows Programming Using MFC and Visual C++ .Net Introduction 11
COURSE OVERVIEW
� Graphical Device Interface
� Device Contexts
� Mapping Modes, Physical and Logical Coordinates
� Fonts
� Context Menus
� Property Sheets
� Printing and Print Preview
� Splash Screens
� Multi-Threaded Programming
![Page 12: Windows Programming Using MFC and Visual C€¦ · Introduction to Windows Programming Using MFC and Visual C ++.Net Introduction 7 COURSE OVERVIEW Introduction to Visual Studio Projects](https://reader034.fdocuments.us/reader034/viewer/2022042515/5f76b5e04c58c73a1c5b5a51/html5/thumbnails/12.jpg)
Introduction to Windows Programming Using MFC and Visual C++ .Net Introduction 12
VISUAL STUDIO
� The Visual Studio is an integrated environment for developing Windows
applications
� The programmer is provided with appropriate tools to view, modify and
edit different parts of the program
![Page 13: Windows Programming Using MFC and Visual C€¦ · Introduction to Windows Programming Using MFC and Visual C ++.Net Introduction 7 COURSE OVERVIEW Introduction to Visual Studio Projects](https://reader034.fdocuments.us/reader034/viewer/2022042515/5f76b5e04c58c73a1c5b5a51/html5/thumbnails/13.jpg)
Introduction to Windows Programming Using MFC and Visual C++ .Net Introduction 13
VISUAL STUDIO
� An application consists of many parts that together make up a project:
� Classes
� Resources
� Dialogs
� Menus
� Icons
� Toolbars
� …
� Parts of an application are stored in different files that are contained within a folder called the project workspace
![Page 14: Windows Programming Using MFC and Visual C€¦ · Introduction to Windows Programming Using MFC and Visual C ++.Net Introduction 7 COURSE OVERVIEW Introduction to Visual Studio Projects](https://reader034.fdocuments.us/reader034/viewer/2022042515/5f76b5e04c58c73a1c5b5a51/html5/thumbnails/14.jpg)
Introduction to Windows Programming Using MFC and Visual C++ .Net Introduction 14
APPLICATION TYPES
� Dialog Based Application
� The main window is a Dialog Box
� Performs a well defined task
� Calculator
![Page 15: Windows Programming Using MFC and Visual C€¦ · Introduction to Windows Programming Using MFC and Visual C ++.Net Introduction 7 COURSE OVERVIEW Introduction to Visual Studio Projects](https://reader034.fdocuments.us/reader034/viewer/2022042515/5f76b5e04c58c73a1c5b5a51/html5/thumbnails/15.jpg)
Introduction to Windows Programming Using MFC and Visual C++ .Net Introduction 15
APPLICATION TYPES
� Single Document Application
� Allows opening of only one document at any given time
� Notepad
![Page 16: Windows Programming Using MFC and Visual C€¦ · Introduction to Windows Programming Using MFC and Visual C ++.Net Introduction 7 COURSE OVERVIEW Introduction to Visual Studio Projects](https://reader034.fdocuments.us/reader034/viewer/2022042515/5f76b5e04c58c73a1c5b5a51/html5/thumbnails/16.jpg)
Introduction to Windows Programming Using MFC and Visual C++ .Net Introduction 16
APPLICATION TYPES
� Multiple Document Application
� Allows opening of more than one document at any given time
� Each document is displayed within a
Childframe which is in turn contained within the client area of the MainFrame
� Word
![Page 17: Windows Programming Using MFC and Visual C€¦ · Introduction to Windows Programming Using MFC and Visual C ++.Net Introduction 7 COURSE OVERVIEW Introduction to Visual Studio Projects](https://reader034.fdocuments.us/reader034/viewer/2022042515/5f76b5e04c58c73a1c5b5a51/html5/thumbnails/17.jpg)
Introduction to Windows Programming Using MFC and Visual C++ .Net Introduction 17
WIZARDS
� Wizards assist programmers by
� constructing a minimal application that is then enhanced by the programmer
� MFC AppWizard
� MFC Console Application
� …
� allowing the programmer to modify the
program in a fairly high level
� Class Wizard
![Page 18: Windows Programming Using MFC and Visual C€¦ · Introduction to Windows Programming Using MFC and Visual C ++.Net Introduction 7 COURSE OVERVIEW Introduction to Visual Studio Projects](https://reader034.fdocuments.us/reader034/viewer/2022042515/5f76b5e04c58c73a1c5b5a51/html5/thumbnails/18.jpg)
Introduction to Windows Programming Using MFC and Visual C++ .Net Introduction 18
WIZARDS
� AppWizard is a tool that based on user specifications, writes a minimal
Windows application using MFC
� Class Wizard is a tool that assists programmer write classes, add
members to classes and write event-handlers
![Page 19: Windows Programming Using MFC and Visual C€¦ · Introduction to Windows Programming Using MFC and Visual C ++.Net Introduction 7 COURSE OVERVIEW Introduction to Visual Studio Projects](https://reader034.fdocuments.us/reader034/viewer/2022042515/5f76b5e04c58c73a1c5b5a51/html5/thumbnails/19.jpg)
Introduction to Windows Programming Using MFC and Visual C++ .Net Introduction 19
CREATING A NEW PROJECT
![Page 20: Windows Programming Using MFC and Visual C€¦ · Introduction to Windows Programming Using MFC and Visual C ++.Net Introduction 7 COURSE OVERVIEW Introduction to Visual Studio Projects](https://reader034.fdocuments.us/reader034/viewer/2022042515/5f76b5e04c58c73a1c5b5a51/html5/thumbnails/20.jpg)
Introduction to Windows Programming Using MFC and Visual C++ .Net Introduction 20
FILE TYPES
File Types
![Page 21: Windows Programming Using MFC and Visual C€¦ · Introduction to Windows Programming Using MFC and Visual C ++.Net Introduction 7 COURSE OVERVIEW Introduction to Visual Studio Projects](https://reader034.fdocuments.us/reader034/viewer/2022042515/5f76b5e04c58c73a1c5b5a51/html5/thumbnails/21.jpg)
Introduction to Windows Programming Using MFC and Visual C++ .Net Introduction 21
PROJECT TYPES
![Page 22: Windows Programming Using MFC and Visual C€¦ · Introduction to Windows Programming Using MFC and Visual C ++.Net Introduction 7 COURSE OVERVIEW Introduction to Visual Studio Projects](https://reader034.fdocuments.us/reader034/viewer/2022042515/5f76b5e04c58c73a1c5b5a51/html5/thumbnails/22.jpg)
Introduction to Windows Programming Using MFC and Visual C++ .Net Introduction 22
MFC AppWizard
![Page 23: Windows Programming Using MFC and Visual C€¦ · Introduction to Windows Programming Using MFC and Visual C ++.Net Introduction 7 COURSE OVERVIEW Introduction to Visual Studio Projects](https://reader034.fdocuments.us/reader034/viewer/2022042515/5f76b5e04c58c73a1c5b5a51/html5/thumbnails/23.jpg)
Introduction to Windows Programming Using MFC and Visual C++ .Net Introduction 23
MFC AppWizard
![Page 24: Windows Programming Using MFC and Visual C€¦ · Introduction to Windows Programming Using MFC and Visual C ++.Net Introduction 7 COURSE OVERVIEW Introduction to Visual Studio Projects](https://reader034.fdocuments.us/reader034/viewer/2022042515/5f76b5e04c58c73a1c5b5a51/html5/thumbnails/24.jpg)
Introduction to Windows Programming Using MFC and Visual C++ .Net Introduction 24
VISUAL STUDIO
� Different parts of the Project are presented in different views:
� Class View
� Resource View
� Solution View
� Documentation is shown within MSDN (Contents)
![Page 25: Windows Programming Using MFC and Visual C€¦ · Introduction to Windows Programming Using MFC and Visual C ++.Net Introduction 7 COURSE OVERVIEW Introduction to Visual Studio Projects](https://reader034.fdocuments.us/reader034/viewer/2022042515/5f76b5e04c58c73a1c5b5a51/html5/thumbnails/25.jpg)
Introduction to Windows Programming Using MFC and Visual C++ .Net Introduction 25
BUILDING A PROJECT
� Building a project requires compiling all files that have been changed since last build and then linking them
![Page 26: Windows Programming Using MFC and Visual C€¦ · Introduction to Windows Programming Using MFC and Visual C ++.Net Introduction 7 COURSE OVERVIEW Introduction to Visual Studio Projects](https://reader034.fdocuments.us/reader034/viewer/2022042515/5f76b5e04c58c73a1c5b5a51/html5/thumbnails/26.jpg)
Introduction to Windows Programming Using MFC and Visual C++ .Net Introduction 26
CLASS VIEW
� Presents and allows the projects underlying classes
Classes and members
![Page 27: Windows Programming Using MFC and Visual C€¦ · Introduction to Windows Programming Using MFC and Visual C ++.Net Introduction 7 COURSE OVERVIEW Introduction to Visual Studio Projects](https://reader034.fdocuments.us/reader034/viewer/2022042515/5f76b5e04c58c73a1c5b5a51/html5/thumbnails/27.jpg)
Introduction to Windows Programming Using MFC and Visual C++ .Net Introduction 27
RESOURCE VIEW
� Presents and allows manipulation the project’s resources
![Page 28: Windows Programming Using MFC and Visual C€¦ · Introduction to Windows Programming Using MFC and Visual C ++.Net Introduction 7 COURSE OVERVIEW Introduction to Visual Studio Projects](https://reader034.fdocuments.us/reader034/viewer/2022042515/5f76b5e04c58c73a1c5b5a51/html5/thumbnails/28.jpg)
Introduction to Windows Programming Using MFC and Visual C++ .Net Introduction 28
SOLUTION VIEW
� Presents and allows direct manipulation of the project’s files (learn not to use it!)
Workspace files
![Page 29: Windows Programming Using MFC and Visual C€¦ · Introduction to Windows Programming Using MFC and Visual C ++.Net Introduction 7 COURSE OVERVIEW Introduction to Visual Studio Projects](https://reader034.fdocuments.us/reader034/viewer/2022042515/5f76b5e04c58c73a1c5b5a51/html5/thumbnails/29.jpg)
Introduction to Windows Programming Using MFC and Visual C++ .Net Introduction 29
MSDN LIBRARY
� Presents various documentation