Dynamic link libraries (DLLs) are in many ways similar to other Visual C++ libraries in that they give the programmer an easy way to distribute new functions and other resources. DLLs differ from other Visual C++ libraries in that they are linked to the application at run time rather than during the compile/link cycle. This process is described as dynamic linking rather than static linking. Static linking occurs when linking C++ run-time libraries to an application at compile/link time. DLLs also offer the advantage in multitasking environments of sharing both functions and resources.
DLLs can be divided into two distinct categories: conventional API-based DLLs written in C or C++ (without objects), and MFC object-based DLLs. API DLLs have the advantage of being portable from one compiler to another. DLLs based on the MFC are, of course, restricted to compilers using a licensed version of the MFC.
Since our focus in this book has been on the MFC, we’ll demonstrate the development of a simple DLL with the use of the MFC library.