Members

Technology Zones

IBM Learning Center

Articles

Hosted By

MaximumASP

Info

Rated
Read 84,802 times

Contents

Related Categories

Creating HTML Help - Mapping Topics to Ids

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. 

James first started writing tutorials on Visual Basic in 1999 whilst starting this website (then known as VB Web). Since then, the site has grown rapidly, and James has written numerous tutorials, articles and reviews on VB, PHP, ASP and C#. In October 2003, James formed the company Developer Fusion Ltd, which owns this website, and also offers various development services. In his spare time, he's a 3rd year undergraduate studying Computer Science in the UK. He's also a Visual Basic MVP.

Comments