I have always hated how C++ guys think they have to use MFC. I do object oriented WinAPI coding all the time. As far as the "cleverness" of the message map goes.... Here's how I determine which class I'm in for Win32 API C++ coding:
Code:
long APIENTRY WindowProc(HWND hWnd, UINT iMessage, WPARAM wParam, LPARAM lParam)
{
ClassName *This = (ClassName *)::GetWindowLong(hWnd,GWL_USERDATA);
if(iMessage==WM_CREATE)
{
CREATESTRUCT *cs = (CREATESTRUCT *)lParam;
::SetWindowLong(hWnd,GWL_USERDATA,(long)(This = (ClassName *)cs->lpCreateParams));
This->m_hwnd = hWnd;
}
return This?This->CallBack(iMessage,wParam,lParam):0;
}
This makes Callback() your "Message Map" and it works well. This is no harder than learning acres and acres of MFC macros.