|
|
Mastering MFC Fundamentals Using Visual C++
Class #1011
Table of Contents
Introduction
At Course Completion
Microsoft Certified Professional Exams
Prerequisites
Course Materials and Software
Course Outline
This course covers the fundamentals of the Microsoft® Foundation Class (MFC) libraries. It is the entry-level course in the Microsoft Visual
C++®/MFC curriculum and serves as a prerequisite to an intermediate-level course.
The goal of this course is to familiarize programmers with the Microsoft Developer Studio™ visual development system and teach them how to create single document interface (SDI) applications using MFC and the Visual C++ development system.
Return to top
At the end of the course, students will be able to:
- Describe Microsoft Windows®-based architecture concepts including event-driven programming, processes, virtual memory models, threading, multitasking, and messaging.
- Describe the basic architecture of an MFC application and the general structure of the MFC Library.
- Use the resource editors and tools provided in Visual C++.
- Create and debug a simple SDI application that outputs text and graphics.
- Use MFC to design, create, and implement menus, toolbars, status bars, and dialog boxes in an application.
Return to top
This course partially prepares you for the following Microsoft Certified Professional exam:
Note: Mastering MFC Development Using Microsoft Visual C++ 5.0 covers the additional topics in this exam.
Return to top
Before beginning this course, students should be familiar with:
- C++ programming skills, including all of the C++ coding constructs common with C
- Windows-based user skills, including using a mouse, menus, the file system, and the Microsoft Internet Explorer interface
- Object-oriented programming terminology and concepts such as objects, properties, and methods
The course materials, lectures, and lab exercises are in English. To benefit fully from our instruction, students need an understanding of the English language and completion of the prerequisites.
Return to top
The course workbook and lab book and student CD are the student's to keep.
The following software will be provided for use in the classroom:
- Microsoft Visual C++ version 5.0
Return to top
Day 1
Chapter 1: Fundamentals and Architecture of Microsoft Windows
Topics:
Understanding Windows architecture
Anatomy of a Windows-based application
Analyzing a simple Windows-based application
Skills:
Students will be able to:
- Define processes, threads, and multitasking.
- Describe the structure of memory management.
- Explain the purpose of messages and the concept of event-driven programming.
- Describe the minimum components of a simple Windows-based application.
- Explain how an application is initialized and windows are created.
Chapter 2: Fundamentals and Architecture of MFC
Topics:
Introduction to MFC
MFC class hierarchy
Documents, views, and the application framework
Skills:
Students will be able to:
- List the major categories of MFC and the primary classes derived from each category.
- Describe the relationship of the foundation class CObject to the other MFC classes.
- Explain the key features CObject contributes to the classes derived from it.
- Define the main base classes used in a typical MFC application.
- Describe the document/view architecture and how this architecture applies to MFC.
- Describe the benefits and costs of document/view, non-document/view, and dialog-based application architectures.
- Describe how MFC maps messages to functions.
Chapter 3: Using Microsoft Developer Studio
Topics:
Introduction to Developer Studio
MFC wizards
Managing your projects
Resource editors
Using the gallery
Information resources
Lab:
Creating an SDI application
Skills:
Students will be able to:
- Use AppWizard to create an SDI application.
- Explain the purpose of the Project Workspace window.
- Describe the benefits of using ClassWizard to create and modify classes.
- Use the Developer Studio Gallery to add a component to an application.
- Use several of the resource editors.
- Gain access to Visual C++ and MFC Help and online documentation.
- Build and run a simple SDI application.
Chapter 4: Creating MFC Applications
Topics:
Classes in a minimal MFC application
Writing applications in non-document/view
Document/view fundamentals
Analyzing a document/view application
Labs:
Hand-coding a minimal MFC application
Using AppWizard to create an MFC application
Skills:
Students will be able to:
- Describe the classes in a minimal MFC application.
- Write a non-document/view application without using MFC wizards.
- Describe the classes used in a document/view application.
- Explain how objects in a document/ view application interact with each other.
- Create a document/view application based on the SDI application using AppWizard.
Day 2
Chapter 5: Debugging
Topics:
Debugging environment
Using the Developer Studio debugger
Adding MFC debugging support
Lab:
Using the debugger
Skills:
Students will be able to:
- Prepare MFC projects for debugging.
- Use the Developer Studio debugger and Visual C++ debugging tools.
- Add MFC debugging support to an application.
Chapter 6: Handling Messages
Topics:
Introduction to messages
Message mapping system
Creating a message map
How MFC processes messages
Using wizards to handle messages
Lab:
Messages with MFC
Skills:
Students will be able to:
- Define what a message is in the Windows operating system.
- List the types of MFC Library messages.
- Describe the purpose and benefits of message maps.
- Declare and implement a message map.
- Describe how the MFC framework processes messages.
- Create the framework for a simple multiple document interface (MDI) application.
- Use ClassWizard and the WizardBar to add or delete an event's message handler.
- Implement a handler member function.
- Add a message box to a handler function to provide information to an end user.
Day 3
Chapter 7: Outputting Text and Graphics
Topics:
Writing output to a device
Using the CDC class
Using graphics device interface (GDI) objects
Working with mapping modes
Special visual effects
Lab:
Drawing graphics and text to the screen
Skills:
Students will be able to:
- Describe a device context.
- List the purposes of CDC, CPaintDC, and CClientDC.
- Output text to the View window.
- List and describe standard GDI objects.
- Output simple graphics objects, such as lines and rectangles.
- Use stock objects effectively in an application.
- Describe mapping modes.
- Describe ROP2 codes.
- Use the BitBlt function.
Chapter 8: Adding User-Interface Features
Topics:
Menus
Toolbars
Status bars
Labs:
Adding static drop-down menus
Changing text in menus
Adding a shortcut menu
Adding a pane to the status bar
Skills:
Students will be able to:
- Add menus, accelerator keys, status bar menu prompts, and toolbar buttons to an application.
- Explain the routing of a command message.
- Dynamically change the state of a menu item.
- Incorporate a context or shortcut menu into an application.
- Add additional panes and graphics to a status bar.
Day 4
Chapter 9: Creating and Using Dialog Boxes
Topics:
Designing and creating dialog boxes
Implementing the dialog-box class
Creating property sheets
Using common dialog boxes
Using list boxes
Labs:
Modifying resources and adding dialog boxes
Using common dialog boxes
Adding a property sheet to an application
Skills:
Students will be able to:
- Define the different types of dialog boxes.
- Explain how dialog boxes are built by using MFC Library.
- Use Dialog Editor to create a dialog-box template.
- Use ClassWizard to create dialog-box classes.
- Write code to manage dialog data exchange (DDX) and data validation (DDV).
- Create an instance of the dialog-box class.
- Create and customize common dialog boxes.
- Create property sheets.
Chapter 10: Creating and Using Templates
Topics:
Overview
Creating function templates
Creating class templates
Using collection templates
Debugging templates
Lab:
Creating class and function templates
Skills:
Students will be able to:
- Describe the advantages of using function and class templates.
- Describe the differences between function templates and class templates.
- Instantiate and override a function template.
- Instantiate a class template.
- Use a template to create a type-safe collection of objects.
Day 5
Chapter 11: Implementing Persistence
Topics:
Serialization
Registry
Lab:
Persisting data
Skills:
Students will be able to:
- Define serialization and how it is integrated in MFC.
- Describe how MFC supports persistent storage.
- Create a serializable class.
- Create and use serializable objects.
- Describe the registry.
- View and modify the registry.
- Programmatically update the registry.
|
|