Checking For a Valid Topic ID in Delphi 7

This section is for programmers. Please use it for all discussons on interfacing help with your applications and related subjects.

Moderators: Alexander Halser, Michael Schwarzl

Post Reply
Leonard Mann
Posts: 11
Joined: Fri Aug 06, 2010 5:48 pm

Checking For a Valid Topic ID in Delphi 7

Unread post by Leonard Mann »

I utilize the HTML Help Kit for Delphi from The Helpware Group in my Delphi 7 Application.
I have since found that EC Software has similar software to help link .chm files into Delphi and maybe I should be using this instead of the Helpware Group.

Anyway, all the forms in my project have a 'Help' Icon on the Title bar.
By pressing the Help Icon I can navigate to the applicable Help page in my .chm file with the following command:

HHDisplayTopic(AppHelpFile,'Accounts_Receivable.htm','windefault', htHHAPI);

If I want to display the Table of Contents I issue the following command:

HtmlHelp(0, PChar(AppHelpFile), HH_DISPLAY_TOPIC, 0);

I would like to setup my Help Topic IDs in H&M5 to the Form Name in my Delphi Application so I do not have to setup the 'Help File' property on all my Forms at design time or runtime.
Therefore, my call to help would look something like this:

HHDisplayTopic(AppHelpFile,self.Name+'.htm','windefault', htHHAPI);

However, not ALL forms have an associated Help Topic.
If the topic does not exist, The help file shows 'This program cannot display the webpage'.
So I would like to check for the existence of a Help Topic ID and if one does not exist, display the Table of Contents.

Is there some function in H&M5 that allows me to do this?

Thanks,
Leonard
User avatar
Alexander Halser
EC-Software Support
Posts: 4098
Joined: Mon Jun 24, 2002 7:24 pm
Location: Salzburg, Austria
Contact:

Re: Checking For a Valid Topic ID in Delphi 7

Unread post by Alexander Halser »

Both components provide the same basic functionality: implementation of the HTML Help API for those Delphi versions which did not have it built-in (D7 was the last, newer versions support HTML Help natively).
If the topic does not exist, The help file shows 'This program cannot display the webpage'.
So I would like to check for the existence of a Help Topic ID and if one does not exist, display the Table of Contents.

Is there some function in H&M5 that allows me to do this?
Not really. The HTML Help API does not have a function to test for the existence of a topic inside a CHM file.
Alexander Halser
Senior Software Architect, EC Software GmbH
Post Reply