23.5. MFC classes are shallow wrappers
You might wonder what the members of the various kinds of MFC classes are. As it turns out, most of the classes have only one member, which is public. These members all have a name which starts with a lower-case m and an underscore: m_. Thus, for instance, the only data member of a CWnd is a public HWND called m_hWnd. What’s an HWND, anyway? It means ‘handle to a window.’ In similar fashion, if you look inside a CDC, you’ll find a public HDC field called m_hDC, where an HDC is a ‘handle to a device context.’
Handles can be described as pointers to pointers. We can think of a handle as being like an index into a table of memory pointers. Saving an object’s memory pointer at a second remove allows the operating ...
Get Software Engineering and Computer Games now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.