HTML Help - Context Help Ids


How do I setup my HTML help to use context help ids? 

Its such a common question and one not really answered in the workshop online help.

Open your project (.hhp) file in notepad or some other text editor.

Add a [MAP] section and define the IDs your require.
Add an [ALIAS] section and define the mapping between each ID and a help topic.

Best to show you by example:

[ALIAS]
IDH_HomePage=default.htm
IDH_TestTopic1=htmlfiles\testtopic1.htm
IDH_TestTopic2=mychm::htmlfiles\testtopic2.htm

[MAP]
#define IDH_HomePage 1000
#define IDH_TestTopic1 1001
#define IDH_TestTopic2 1002

Alternatively you can do this:

[ALIAS]
#include myhelp.ali

[MAP]
#include myhelp.h

where myhelp.ali is a text file containing

   IDH_HomePage=default.htm
   IDH_TestTopic1=htmlfiles\testtopic1.htm
   IDH_TestTopic2=mychm::htmlfiles\testtopic2.htm

and myhelp.h is a text file containing

   #define IDH_HomePage 1000
   #define IDH_TestTopic1 1001
   #define IDH_TestTopic2 1002

That's it. Nothing much to it is there? Recompile your .HHP file. Now your application can call help using context help Ids instead of topic file names.

My Context Calls Don't Work? 

I've seen a few reports of contextual help not working. According to MVP David Liske it appears to be related to using the #included statement. David's fix is to add the include file under the [FILES] section of the .hhp file. Thanks David.


Want to contribute? Correct? Email us Info@Helpware.net

Return Home