Leader: Bruce Arnold (b a r n o l d @ b l a s t . n e t)
Summary by: Ron Murawski (email@example.com)
C/C++ User Group
December's main presentation was by James Carr. He explained the inner workings of the source code to a Microsoft Systems Journal (MSJ) article written by Windows programming expert Jeff Prosise. The article was called "Programming Windows 95 with MFC, Part III: Processing Mouse Input". It appeared in the August 1995 issue of MSJ.
James explained that the "MFC" part of the title refers to the Microsoft Foundation Classes. MFC is a C++ class library for Windows. Its purpose is to make the task of programming Windows easier. MFC provides abstractions of complex features that, once understood, allow for simpler coding than the older Windows API calls.
James showed that the most glaring difference between programming the old way (API) and the new way (MFC) is in the message handling code. Whereas with API programming you must use convoluted callback handlers and message crackers, with MFC you simply enumerate the messages you intend to handle and then, function by function, create them to handle each message.
The demonstrated program plays tic-tac-toe. A left-click places an "X" and a right-click an "O". Legal moves are enforced and wins are detected automatically. The declaration of the functions: OnLButtonDown and OnRButtonDown were as simple as James promised they would be. With separate functions to handle each event, much of the complexity that is found in a typical API program vanished.
The source code and executable are available from the ACGNJ ftp server at:
See SOURCE CODE links below.
Source Code FilesFor help, email me at b a r n o l d @ i e e e . o r g