A header file is a typical resource file used by programming languages such as C/C++. That kind of files contains a table with names and a numerical resource ID. The name is used by the programmers to build the application’s windows, the fields, the buttons, the list boxes, etc. The C/C++ compiler maps these names to the associated resource IDs.
The contextual help on these applications is supported by extracting the resource ID and using this as a unique help item.
If the application is not yet equipped with help data and you want to provide context sensitive help then you can import such a header file in a Workbench project folder. The result is a dependant folder and topic per entry in the header file. In this way you do not have to create the structure of the help from scratch.
In the next example we use an imaginary sample C/C++ application without any help yet. We have created a new project ‘WinHelp header sample’ in the HelpServer Workbench. Next, we import one or more of the header files.
Importing a WinHelp header file
Popup the menu of the ‘WinHelp header sample’ folder and select ’Import > WinHelp header’.
Selecting the file
Select the .h file on the ‘File chooser’ and click ‘OK’ to continue. You can also select multiple files.
Starting the import
Click ‘Start’ to start the import process.
Because the default class structure is not always suitable it is advisable to choose the option ‘Let me select the classes’ on the ‘Import window’. Then you can select the classes manually.
Assigning the main folder class
Any folder class will do, as long as the folder class provides a topic in its structure.
Topic class and topic type selection
In case the option ‘Let me select the language’ on the ‘Import window’ was checked then you will be prompted to select the language. Else the default working language will be used.
Language selection
Select the language and click ‘Next’ to continue.
Next image shows the converted header file.
A converted WinHelp header file
|
|
Importing multiple header files in one project
If the application resource Ids remain in multiple files (for example one header file per window) then you can repeat the previous steps until all resource Ids are loaded. It is advisable to assign a recognizable name to the resulting folder or to change the description after the import.
Assigning pointers and resource Ids manually
Also consider assigning a unique pointer and a resource ID to each of the imported folders. You can do this by selecting the main project folder in the tree on the left and then on the table on the right you popup the menu and select ‘More’.
Next, you double click in the ‘Pointer’ cell to edit and to enter the name. This could be for example the name of the window.
Perform the same action in the ‘Resource ID’ column to enter the resource ID. That will be the window’s resource ID.