Copying the Help Message Map Commands

AppWizard places Help-specific code into the message map in the frame window class implementation file, MainFrm.cpp.

To copy help-related code to Scribble

  1. Open the HelpApp project MainFrm.cpp file and your Scribble project version of MainFrm.cpp.

  2. Scroll to the Help-related code, delineated by the //global help commands comment, in the message map section of the HelpApp MainFrm.cpp file.

  3. Copy this code, shown below, from the HelpApp MainFrm.cpp file, and paste into the same position in the message map in Scribble’s 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’ve 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.

  4. Close the HelpApp project’s MainFrm.cpp file, and save the changes to Scribble’s MainFrm.cpp.