HOWTO: Prepare HTML Help Files for Context-Sensitive Help

ID: Q189453


The information in this article applies to:


SUMMARY

This article describes how to set up an HTML Help project file so that the HTML Help API command, HH_HELP_CONTEXT, can be used in an application. This is actually the first step of a two-step process. Step two is to set up your application to use the HTML Help API to invoke context-sensitive Help.


MORE INFORMATION

This article assumes that you already have an existing help project file to work with.

NOTE: It is recommended that you use a text editor, such as Microsoft Notepad or Microsoft WordPad, to edit the MAP and ALIAS sections of the HTML Help project file. For additional information, please see the following article in the Microsoft Knowledge Base:

Q188444 BUG: Editing MAP or ALIAS in the HTML Help Workshop Causes Error

Step-by-Step Procedures

  1. Add the [ALIAS] section to the HTML Help project file. Following is an example of the [ALIAS] section:
    
    [ALIAS]
    IDH_FILE_NEW   = newfile.htm
    IDH_FILE_OPEN  = openfile.htm
    IDH_FILE_SAVE  = htm\savefile.htm 
    The purpose of the [ALIAS] section is to associate .htm files with constants. The constants are not defined in the [ALIAS] section (see the following step 2). The constants should not be numbers. For example, the following statement in the [ALIAS] section is not valid:
    5 = newfile.htm
    NOTE: If an .htm file is in a subfolder, the name of the subfolder should be included. See IDH_FILE_SAVE in the above [ALIAS] section.


  2. Add the [MAP] section to the HTML Help project file. The [MAP] section is required when you use an [ALIAS] section. The [MAP] section should appear after the [ALIAS] section. The purpose of the [MAP] section is to define or give numeric values to the constants in the [ALIAS] section. Following is an example of the [MAP] section:
    
    [MAP]
    #define IDH_FILE_NEW   1
    #define IDH_FILE_OPEN  2
    #define IDH_FILE_SAVE  3 
    NOTE: If the application that will use the Help files is written using Visual C++ the [MAP] section can also appear as follows:
    
    [MAP]
    #include "context.h" 
    In this case, the file Context.h contains the following define statements:
    
    #define IDH_FILE_NEW   1
    #define IDH_FILE_OPEN  2
    #define IDH_FILE_SAVE  3 


  3. Save and close the project file with the text editor.


  4. Open the project file in HTML Help Workshop, and compile it.



Test the compiled HTML Help file (.chm) by performing the following steps in HTML Help Workshop:

  1. Open the project file.


  2. From the Test menu, click HTMLHelp API.


  3. In the Command list select HH_HELP_CONTEXT.


  4. In the Window edit box, enter the name of a window defined in the [WINDOWS] section. If you do not have a [WINDOWS] section, this field should be blank.


  5. In the Map Number edit box, enter a number defined in the [MAP] section. When you press the Test button, the correct topic should appear.



REFERENCES

HTML Help Web Site:

http://msdn.microsoft.com/workshop/author/htmlhelp/default.asp
For additional information, please see the following articles in the Microsoft Knowledge Base:
Q189086 HOWTO: Create Context-Sensitive HTML Help in a Visual Basic App
Q191118 HOWTO: Create Context-Sensitive HTML Help in an MFC Application

Additional query words:


Keywords          : kbHTMLHelp kbHTMLHelp110 kbGrpDSTools kbHTMLHelp121 
Version           : WINDOWS:1.1,1.21
Platform          : WINDOWS 
Issue type        : kbhowto 

Last Reviewed: June 7, 1999