Creating HTML Help

Mapping Topics to Ids

In order to be able to specify what topic to display from your VB program, you need to map Topics to ID's, and then give the ID's values.

The first thing we need to do is alias the topics to topic ID's. Even if you specify a topic ID within the topic file itself, you may as well do it as a comment, because the workshop has no way to extract that information.  Click on the API button , and go to the Alias tab of the resulting dialog box:

Click add to specify a Topic ID for each topic file:

We use the IDH naming system because every one else does - it has become the standard, and who are we to argue? Try to make the Topic ID as clear as possible, so that you can remember what topic it links to, even after a hard days work. Then, select the file you want it to refer to.

Next, we need to assign a value to the Topic ID constant (that we will pass from VB). The HTML Help workshop does not allow you to do this, so, save your work and close the project, and go back to notepad. Go to the Alias section, and you will see some ID's, and the files you have assigned them to.

[ALIAS]
IDH_FIND_DIALOG=htmlfind_dialog.htm
IDH_DLG_INSERT_SYMBOLS=htmlinsert_symbols.htm
IDH_WELCOME=htmlwelcome.htm

Now, go to the Map section (which probably does not actually exist yet, in which case, create it below the Alias section). We need to add some statements that will assign a value to each Topic ID. We use the following syntax:

#define TOPIC_IDCONTEXT_INTEGER

Here is an example:

[MAP]
#define IDH_FIND_DIALOG 1010
#define IDH_DLG_INSERT 1020
#define IDH_WELCOME 1000

Again, because every one else does, the Context Integers start from 1000 and work up in increments of 10. Save the file, and reload the file from the HTML Workshop. 

You might also like...

Comments

About the author

James Crowley

James Crowley United Kingdom

James first started this website when learning Visual Basic back in 1999 whilst studying his GCSEs. The site grew steadily over the years while being run as a hobby - to a regular monthly audien...

Interested in writing for us? Find out more.

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“PHP is a minor evil perpetrated and created by incompetent amateurs, whereas Perl is a great and insidious evil perpetrated by skilled but perverted professionals.” - Jon Ribbens