MFC Programming for C++ Programmers
Students Will Learn:
- Developer Studio IDE
- Windows Programming Model
- MFC Class Hierarchy
- Serialization & Persistence
- Message Handling
- MFC Controls
- Menus and Dialogs
- Graphic Device Interface
- ADO/ODBC Database Programming
Course Description: This hands on MFC programming course presents the structure and use of Visual C++ and the Microsoft Foundation Class (MFC) library for Graphical User Interface programming, the Document/View architecture, SDI, MDI, ODBC, and DAO programming. The course includes the use of the Visual Studio automated tools (wizards), but emphasizes a thorough grounding in event driven programming and the MFC object hierarchies. Upon completion of the course, students will understand the structure of the MFC and how the objects interact. The course provides an introduction to how Windows works at the message level, important for debugging as well as for understanding MFC objects. Students will become familiar with important base classes and the inheritance hierarchy; understand how the hierarchies are organized; and learn how MFC objects interact with the Windows operating system.
Course Prerequisites: A working knowledge of C++.
MFC Programming for C++ Programmers Course Overview:
Developer Studio IDE
- Developer Studio
- Docking Windows
- Project Views: File, Class, Resource
- Using InfoViewer
- Debugging Tools
- AppWizard and ClassWizard
- Building a Skeleton Project
|
Serialization and Persistent
Documents
- CArchive Object
- Document Serialization
- Serializing Pointers
- Creating Persistent Classes
- Serializing CObject Pointers
- Serializing Collections
|
Windows Programming Model
- Windows Software Architecture
- Event-Driven Programming
- Messages and Message Encapsulation
- Windows Libraries and APIs
- Resources and Resource Types
|
The Mouse
- Windows Mouse Processing
- CWnd Class Mouse Support
- Capturing the Mouse
- Mouse Cursor
- Using MFC for Drawing with the Mouse
|
MFC Class Hierarchy
- MFC and the Application Framework
- MFC Base Classes
- Elements of an MFC Program
- MFC Collection Classes
- Iterating Collections
- Documents
- Document/View Architecture
- Frames
- MFC Diagnostic Facilities
- Exceptions
|
Menus
- Logical Menu Design
- Style Recommendations
- Building a Menu
- Menu Resources
- Command Routing
- Implementing Message Handlers
- Specifying Shortcuts and Accelerators
- Dealing with Unavailable Options
- CMenu Class and Dynamic Context Menus
- MFC Strings and Use of Stringtables
|
Message Handling
- Message Handling
- The Message Map
- Adding Message Handlers with ClassWizard
|
The Keyboard
- Windows Keyboard Conventions
- Keystroke and Character Messages
- Capturing Keystroke Input
|
The CWND Class
- CWnd Encapsulation of Windows
- CWnd Class Hierarchy
- Changing Window Class Attributes
- Window Activation and Keyboard Focus
|
MDI and Multiple Views
- SDI vs. MDI Applications
- Multiple View Types
- Multiple Views Under SDI and MDI
- Document Templates
- Instancing a View
- Adding a New Document Class
|
Document/View Architecture
- The Document/View Model
- Document and View Classes
- Document Templates
- Saving and Loading Documents
- Using Multiple Views
- SDI and MDI Application Styles
- Decoupling Document and View
- Navigating the Classes
|
Controls
- Mapping Control Variables
- Modifying Control Attributes
- Push Buttons, Check Boxes, RadioButtons
- Edit Controls
- List Boxes and Combo Boxes
- Tree Controls
- Spin Buttons, Progress Bars, and Sliders
- Control Views
|
Splitter Windows
- Static and Dynamic Split Views
- Creating a Dynamic Split Window
- Add a Dynamic Splitter as a Separate MDI View
- Integrating a Static Split Window
- Synchronizing Document and Views
|
Introduction to Resources
- Windows Resources Overview
- Icons, Cursors, and Bitmaps
- Toolbars and Status Bars
- Strings and Fonts
- Menus and Dialogs
|
Dialogs
- Dialog Modality
- Programming a Modal Dialog
- Programming a Modeless Dialog
- Connecting Code to the Dialog with ClassWizard
- Building Custom Dialogs
- Handling Control Messages
- Using OCX Controls
- Keyboard Traversal
- Data Communication Between Dialog and Parent
- Common Dialog Boxes
- Property Sheets and Tabbed Dialogs
- Connecting a Dialog to a Menu Item
- DDX/DDV
|
The Graphics Device Interface
- Device Contexts and CDCs
- GDI Drawing Tools and Attributes
- GDI Object Creation and Cleanup
- Colors
- GDI Coordinate Systems and Mapping Modes
- Regions and Clipping
- Drawing Functions
- Text Functions
- Pens and Brushes
- Fonts
- Bitmaps and DIBs
- Icons and Cursors
|
Database Programming
- MFC Capabilities
- The Jet Engine
- MFC Database Classes
- Using CRecordView
- Overview of SQL
- DAO
- What is DAO?
- DAO Objects
- DAO Classes
- AppWizard and ClassWizard Support
- Browsing, Adding, Updating and Deleting Records
- ODBC
- What is ODBC?
- ODBC Administration
- ODBC Classes
- AppWizard & Class Wizard Support
- Browsing, Adding, Updating and Deleting using CRecordSet
|
Form Views
- Form, Scroll, and Edit Views
- Creating a Form View from a Dialog Template
- Adding a Form View to a Document
- Handling Messages for View Controls
- Initializing and Sizing the Form View
- Preventing User Resizing
|
Student Testimonials
"After attending this class, I will say that it was the BEST training I have ever had. The instructor was exemplary and he is well qualified. He was so patient and knowledgeable. Your assistance and especially customer service, is also exemplary. You have both made my experience with HOTT a terrific one. I will recommend HOTT to everyone that needs computer related training. In the future, I will only utilize HOTT for my training needs."
K.K., Puget Sound Workers' Compensation Trust
"I wish I had taken this course in 95 when I first started programming for Windows. This course has cleared up many technical questions I had about the operation of Windows and how to better program for Windows. The instructor was exceptionally knowledgeable and communicated his knowledge clearly and answered my many questions. He also has excellent speaking skills. (no umms or ahhs)"
L.A., Manitoba HVDC Research Center