1.2 General Class Design Philosophy

Microsoft Windows was designed long before the C++ language became popular. Because thousands of applications use the C-language Windows application programming interface (API), that interface will be maintained for the foreseeable future. Any C++ Windows interface must therefore be built on top of the procedural C-language API. This guarantees that C++ applications will be able to coexist with C applications.

The Microsoft Foundation Class Library is truly an object-oriented interface to Windows that has met the following design goals:

Execution speed comparable to that of the C-language API

Minimum code size overhead

The ability to call any Windows C function directly

Easy conversion of existing C applications to C++

The ability to leverage from the existing base of C-language Windows programming experience

True Windows API for C++ that effectively uses C++ language features

Solid foundation for future extensions

The single characteristic that sets the Microsoft Foundation classes for Windows apart from other Windows class libraries is their direct access to the C-language Windows API. This direct access does not, however, imply that the classes are a replacement for that API. Developers must still make direct calls to some Windows functions, GetSystemMetrics, for example. A Windows function is wrapped by a class member function only if there is a clear advantage to doing so.

Because you often need to make native Windows function calls, you should have access to the C-language Windows API documentation. This is included with Microsoft C/C++ as Help. If you require printed documentation, refer to the Microsoft Windows Programmer's Reference and the Microsoft Windows Guide to Programming from Microsoft Press. Another useful book is Programming Windows by Charles Petzold, also from Microsoft Press. Many of that book's examples can be easily converted to the Microsoft Foundation Windows classes.