Windows Classes

Both Windows and C++ are object oriented, and it is natural to use an object-oriented language to interface with an object-oriented graphical user interface. The Windows classes in the Microsoft Foundation Class Library provide the link. These classes offer the following features:

Close coupling to the C-language Windows library

The Microsoft Foundation Windows classes are really a direct C++ wrapping of the familiar C functions for Windows. This feature provides maximum speed and storage efficiency, and it offers total programming flexibility. The resulting programs are as fast and small as C programs, and they can incorporate C-language function calls (including Windows calls) anywhere.

Significant reduction of programming “surface area” from C

C++ source programs for Windows are smaller and easier to understand because many complex functions are encapsulated in the classes. You derive your own application classes from the library's base classes. These derived classes give you access to all the base class functionality without code duplication.

Wide array of useful window classes

The library contains ready-made, derivable classes for ordinary frame windows, Multiple Document Interface (MDI) frame and child windows, edit controls, list boxes, combo boxes, buttons, and so forth.

Efficient processing of Windows messages

The Microsoft Foundation Windows classes replace error-prone case statements with C++ member functions. You specify, by means of a special syntax called a “message map,” which Windows “notification” messages you expect; then you write the necessary member functions. No space-consuming virtual functions are necessary. C++ member functions are thus effectively reconciled with Windows queued messages.

Ability to derive “midlevel” window classes

If your application needs a feature, such as scrolling, repeated in many different windows, you can write an abstract window class that contains this functionality by deriving it from one of the Microsoft Foundation Classes. Then you can further derive special-purpose classes that share the desired feature.

Useful utility classes

There are useful classes for common Windows objects such as display contexts, pens, brushes, menus, points, and rectangles. These classes permit you to maximize your use of the C++ language.