Visual C++/MFC Tutorial - Lesson 4: MFC Basics Lesson 4: MFC
Basics Are you ready to start programming? No you are not. You
don't want me to teach you a stupid 'hello world' application,
do you? If you want to make the most of Visual C++ you have to
use Microsoft Foundation Classes (MFC). These classes are great
because they wrap all of those handles we talked about in the
first lesson with easy to use classes. The most important to you
right now is the class CWnd. This wraps the functions which
needed a window handle (HWND). Remember that PostMessage
function I mentioned? PostMessage(your_HWND, WM_PAINT, 0,0);
Well now we can take our windows class and call it's member
function. MyCWnd.PostMessage(WM_PAINT, 0, 0); This does the same
thing, but now we don't have to keep track of the window
handles. But don't be fooled, they are still there. We can still
use them too. They are now just member variables of the class.
The handle to the window a CWnd is associated with in the member
variable m_hWnd. We can call t