add F1 feature
2025-11-13
Written by: xiaobin
The message map is MFC’s way of avoiding the lengthy vtables that would be required if every class had a virtual function for every possible message it might receive. Any class derived from CCmdTarget can contain a message map.
DECLARE_MESSAGE_MAP()
BEGIN_MESSAGE_MAP(CMyApp, CWinApp)
ON_COMMAND(ID_HELP, &CWinApp::OnHelp)
END_MESSAGE_MAP()
BEGIN_MESSAGE_MAP( theClass, baseClass )
Parameters:
Specifies the name of the class whose message map this is.
Specifies the name of the base class of theClass.
MyApp.cpp
#include "stdafx.h"
Copy stdafx.h and targetver.h to the project directory.
MyApp.h
Use
#ifndef __AFXWIN_H__
#error "include 'stdafx.h' before including this file for PCH"
#endif
instead of
#include <afxwin.h>