These course materials were jointly created by myself and James Kearney, owner of Messaging Systems Group, one of the corporations through which I taught prior to 9/11/01.
Visual Studio .NET includes C++ with MFC 7.0, the first improvement to this
tool in over three years. It was worth the wait. In addition to required
modifications to MFC to mask and support the changes required by the .NET
framework, classes have been added to support Web Services; the Standard
Template Library has been modified to bring it more into compliance with
standards; and classes such as CString have been made available for ATL
as well as MFC applications.
Five days. This course may be presented in abbreviated form in three days, as a companion course with Introduction to C++ ("C++ and Windows Programming In A Week"), More exercises and "bells and whistles" can be explored in the five day version, for those who are already expert with the C++ language.
Introduction to Windows Programming
This chapter teaches what is going on "under the hood" in a Windows application, by taking the user through the experience of creating a simple Windows application in C, using the Windows SDK (System Development Kit). The exercises in this chapter are omitted in the three-day version of this course.
- The Single Document and Multiple Document interfaces
- The six application types
- Working in an event-driven, object-oriented environment
- Windows handles and other data types
- "Hungarian" notation
- WinMain and the Window procedure
- The message loop
- Declaring and registering a window class
- Creating a window
- The three major window styles
- Terminating a Windows application
Microsoft Foundation Class Library
In this chapter, we re-create the C/SDK application of the previous chapter with an equivalent in MFC. This gives the student a chance to actually create MFC code from scratch, an opportunity not afforded by the various Visual C++ wizards.
- The CWinApp class
- making the most of precompiled header files
- The CWnd class
- Important CWnd member functions
- Creating a frame window in MFC
- Message maps
- Drawing on a window
- The Windows coordinate systems
- The device contexts
- Color representation in Windows
- The CString class and resource strings
Off to See The Wizards
Finally, in this chapter, we generate a Microsoft App Wizard application (which we will enhance throughout the remainder of the course), and examine the output code.
- The App Wizard and the Class Wizard
- The concept of the "document"
- Document/View architecture
- The CDocument class
- Document views and the CView class hierarchy
- The Document Manager
- MFC representations of size and location
- The Graphics Device Interface
- Brushes and pens
- Working with menus
- The standard Windows menu layout
- Menu handlers
- Modifying menus at run-time
- Modifying the standard toolbar
- Creating custom icons*
- Customizing the status bar*
- Implementing status bar indicators*
MFC Containers
In this chapter we implement window image persistence by storing data points in a container and adding behavior to the OnDraw event handler.
- Designing and implementing a custom class for data points
- The Standard Template Library vs. the MFC Container Classes
- Templatized collections
- Arrays, lists and maps
- Making a class containable
- Notifying other views of document changes
Serialization
In this chapter, the application is enhanced to support writing to and reading from disk.
- Three document management schemes
- An object-oriented hourglass
- The CArchive class and MFC serialization
- Supporting polymorphic object creation
- Making child classes streamable
- Disabling File..Save when the document is unchanged
- Supporting multiple object versions*
Controls and Modal Dialogs
This final chapters guides the student to the place he or she will spend the most time: Designing, implementing, and using dialog boxes.
- Modal vs. modeless dialogs
- Dialog coordinates
- Dialog processing
- Using the common dialogs
- Working with controls
- Standard control styles
- Standard controls: Static, Edit, Listbox, Combo, Button, Scroll
- Using Class Wizard to create a dialog class
- Associating member variables with dialog controls
- Pen styles
* Indicates a topic that is omitted in the abbreviated, three-day version of this class.