Instead of creating an application using "raw" Win32 classes and functions, the MFC library simplifies this process by providing a mechanism called the framework. The framework is a set of classes, functions, and techniques used to create an application as complete as possible with as few lines of code as possible. To provide all this functionality, the framework works behind the scenes with the CWinApp class to gather the necessary MFC classes and functions, to recognize and reconcile the Win32 classes that the application needs. This reconciliation is also made possible by a set of global functions. These functions have names that start with Afx... Some of these functions are:
- AfxFormatString1
- AfxFormatString2
- AfxMessageBox
- AfxFreeLibrary
- AfxGetApp
- AfxGetAppName
- AfxGetInstanceHandle
- AfxGetMainWnd
- AfxGetResourceHandle
- AfxInitRichEdit
- AfxLoadLibrary
- AfxMessageBox
- AfxRegisterWndClass
- AfxSocketInit
- AfxSetResourceHandle
- AfxRegisterClass
- AfxBeginThread
- AfxEndThread
- AfxGetThread
- AfxWinInit
We will come back to some of these functions and we will see many other MFC macros in later lessons.
Comments
Post a Comment