Mapping Context IntegersUpdated March 1, 2003
Mapping help topics in an HTML Help file for use with an application isn't a difficult procedure, but it's really not covered too well in too many locations. Here's the scoop on just what you need to know about the specific areas of the HHP file that make this work.
This section lists all of the topic source files for the project:
; more files may be listed here
When the HTML Help Workshop converts a WinHelp project to an HTML Help project, it also creates two subfolders: "html", and "images". You should create these same folders for the majority of your source files as well. It assists greatly in keeping things organized.
The source file section of the project file can be modified by clicking the Add/Remove Topic Files button in the workshop. Clicking this button brings up a simple dialog for accomplishing the task.
This section of the project file is a bit more complex:
; more Aliases may be listed here
Here, we're aliasing each required topic file to a topic ID. This uses the standardized IDH_ prefix used by the developers of WinHelp. It's still a valid constant-based ID system that works well, so we'll continue to use it. These are set via the Alias tab of the API Information dialog.
Note that the context ID's are arbitrary ... you can make them up in any manner you wish. However, the IDH_ prefix is recommended as, once again, it assists in keeping things organized.
This section then equates the individual topic ID's to context integers for use within our Help system. The context integers are kept in a header file, which has a *.h file extension. The information in this header file is rather straightforward:
#define IDH_CI_CONTENTS 1060
#define IDH_CI_INTRO 1040
#define IDH_CI_STEP_1_OF_2 1010
#define IDH_CI_STEP_2_OF_2 1080
// more context integers may be defined here
It is recommended, though, that they begin with 1000 and increment in steps of 10. This in line with older recommendations about the WinHelp system.
Note that these are in the C++ constant-definition syntax. These cannot be written within the HTML Help Workshop itself. This file can be created in NotePad, then added to the HHP project file through the API button. The result is an HHP entry that looks like this:
That's all there is to it. There's nothing you have to do to the specific HTML files to get this going. It's all in the HHP file.