BEGIN_MESSAGE_MAP(CDemoView, CView)
//{{AFX_MSG_MAP(CDemoView)
ON_COMMAND(ID_FILE_NEW, OnFileNew)
ON_COMMAND(ID_FILE_SAVE, OnFileSave)
//}}AFX_MSG_MAP
ON_COMMAND_RANGE(9000,9999,OnCmdGroup)
END_MESSAGE_MAP()
This message map will route all command ID's from 9000-9999 to the OnCmdGroup function. This function is a bit different from an ordinary command handler:
void CCol20View::OnStation(UINT id)
{
// do your thing for command id
}
As you might guess, the id parameter is the command ID that triggered the routine.