Copying the Help Message Map Commands
The MFC Application Wizard places help-specific code into the message map in the frame window class implementation file, MainFrm.cpp.
To copy help-related code to your project
Open the HasHelp project MainFrm.cpp file and your project's version of MainFrm.cpp.
Scroll to the Help-related code, delineated by the //global help commands comment, in the message map section of the HasHelp MainFrm.cpp file.
Copy this code, shown below, from the HasHelp MainFrm.cpp file, and paste into the same position in the message map in your MainFrm.cpp.
// Global help commands ON_COMMAND(ID_HELP_FINDER, CMDIFrameWnd::OnHelpFinder) ON_COMMAND(ID_HELP, CMDIFrameWnd::OnHelp) ON_COMMAND(ID_CONTEXT_HELP, CMDIFrameWnd::OnContextHelp) ON_COMMAND(ID_DEFAULT_HELP, CMDIFrameWnd::OnHelpFinder)
You have already seen how ID_HELP_FINDER and ID_CONTEXT_HELP are called. When the user presses F1, the framework calls ID_HELP and directly handles this command so long as the application contains help support.
Close the HasHelp project's MainFrm.cpp file, and save the changes to your project's MainFrm.cpp.
See Also
Tasks
Adding HTML Help Context-Sensitive Help to an Existing MFC Application