If you are including context-sensitive Help as a feature of your Help system, you can use the Help Project Editor to map context IDs in the application to context IDs in your topic files.
The Application Contexts dialog box displays all the context ID numbers, Help context strings, and application context strings entered for the current Help project file.
Note The Application Contexts dialog box defines the [MAP] and [ALIAS] sections of the Help project file.
To map context IDs
1.1.From the Edit menu, choose Application Contexts.
The Application Contexts dialog box appears.
2.2.Define the context ID mappings for this Help file (see the following section).
Or enter the context ID mappings from an existing text file.
3.3.If you are using hexadecimal ID numbers, select the Display Numbers In Hexadecimal check box.
4.4.To save the changes without closing the dialog box, choose the Define button.
Or choose OK to save the changes and close the dialog box.
To define a new context ID
1.1.From the Edit menu, choose Application Contexts.
The Application Contexts dialog box appears.
2.2.From the list box, select New Context.
3.3.In the Context Number box, type a context number.
If you are using hexadecimal ID numbers, select the Display Numbers In Hexadecimal check box.
4.4.In the Help Context String box, type a context string.
5.5.Choose the Define button.
You can add new context IDs to the Help project file by hand using the Define button. However, context IDs entered by hand do not have an application context string. Help context strings and context ID numbers entered by hand are saved in this format:
[MAP]
Help_Context 0xFF
Help context strings entered by hand do not use #define.
Updating Context IDs from a File
If you or the application developers create a file containing the application context IDs and ID numbers, you can read this information into the Help project file rather than entering it by hand. It is usually preferable to use this option to enter context IDs if the IDs are generated by developers and maintained in one of the application’s resource files (an .H file, for example). Also, context IDs entered from a file have an application context string.
Context IDs are entered or updated from a file in this way:
nIf the application context string does not appear in the [MAP] section of the Help project file, the Help context string matches the application context string.
nIf the application context string appears in the [MAP] section of the Help project file, only the context ID number is updated.
nIf the [MAP] section of the Help project file contains application context strings that do not appear in the resource file, they are deleted along with their associated Help context strings.
To enter or update context IDs from a file
1.1.From the Edit menu, choose Application Contexts.
The Application Contexts dialog box appears.
2.2.Choose the Update button.
The Update Contents From Application File dialog box appears.
3.3.If the file is on a different drive, select the drive you want from the Drives box.
If the drive to which you want to change does not appear in the Drives box, it may be a network drive to which you are not connected. Connect to the drive, and then use this dialog box option.
4.4.In the Directories box, double-click the directory you want.
Or press the UP ARROW or DOWN ARROW key to select the directory, and then press ENTER.
Windows displays the names of all files in that directory that are the type selected in the List Files Of Type box. To display a different type of file, select the type you want from the List Files Of Type box.
5.5.In the File Name box, double-click the name of the file that has the context IDs.
Or select the file, and then choose OK.
Or type the filename in the text box, and then choose OK. You can enter a full path in this box, including drive and directories.
The context IDs are displayed in the list box.
Application context strings, Help context strings, and context ID numbers entered or updated from a file are saved in this format:
[ALIAS]
APPLICATION_CONTEXT=Help_Context
[MAP]
#define APPLICATION_CONTEXT 0xFF
If the Help context string is the same as the application context string, the entry in the [ALIAS] section is omitted. The #define directive appears with the application context ID in the [MAP] section because the ID was entered from a file.
Updating Context IDs from More Than One File
If the context IDs you are mapping to the Help file are contained in more than one file, you can use the #include directive to update from all the files.
To enter or update context IDs from more than one file
1.1.Create a file that contains all the files you want to use in the update.
You can use the #include directive to include the extra files.
2.2.From the Edit menu, choose Application Contexts.
The Application Contexts dialog box appears.
3.3.Choose the Update button.
4.4.Follow steps 3 through 5 above to open the resource file.
You can edit context ID numbers and Help context strings. The Help Project Editor also displays application strings so that you can correctly map your Help context strings to the appropriate application context strings. You cannot, however, edit or modify an application context string.
To edit a context ID number or Help context string
1.1.From the Edit menu, choose Application Contexts.
The Application Contexts dialog box appears.
2.2.Select the context ID you want to edit.
Or select New Context to define a new context ID for the Help project file.
3.3.Type a new context ID number or edit the current context number shown in this box.
If you are using hexadecimal ID numbers, select the Display Numbers In Hexadecimal check box.
4.4.Type a new context string or edit the current context string shown in this box.
5.5.Choose the Define button.
You can delete any context IDs from the Help project file when they are no longer necessary or valid.
To delete a context ID
1.1.From the Edit menu, choose Application Contexts.
The Application Contexts dialog box appears.
2.2.Select the context ID you want to delete.
3.3.Choose the Delete button.
The Help Project Editor will display a dialog box to confirm the deletion if the context ID is not part of a resource file.