Dual Mode Context Sensitive Help in Delphi 5

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
mofnet
Posts: 5
Joined: Mon Jan 20, 2003 2:02 am

Dual Mode Context Sensitive Help in Delphi 5

Unread post by mofnet »

I am new to help authoring and need some additional direction to implement dual mode context sensitive help in my Delphi 5 application. My application is successfully using the CHM file via the EHS components, but I'm not sure how to tell it to use the separately created WinHelp file containing popup information.

Thanks in advance.

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

Unread post by Alexander Halser »

This is defined by the HelpType property of the HelpRouter component. Simply set it to "htMixedMode" and set the name of HelpRouter.CHMPopupTopics to the HLP file name.
Alexander Halser
Senior Software Architect, EC Software GmbH
mofnet
Posts: 5
Joined: Mon Jan 20, 2003 2:02 am

Unread post by mofnet »

Alexander,

Thanks for pointing me in the right direction, but still don't understand something. Help & Manual is creating two files: MyApp.chm and MyApp_popup.hlp. I have the following line of code in the OnCreate event of my main form:

Application.HelpFile := ExtractFilePath(Application.ExeName) + 'MyApp.hlp';

I have the following properties set in the HelpRouter:

CHMPopupTopics := MyApp_popup.hlp;
HelpType := htMixedMode;

With this configuration, the popup file is not found. The error message says it's looking for MyApp.hlp. If I change the name of MyApp_popup.hlp to MyApp.hlp, everything works, but that seems to defeat the purpose of setting the CHMPopupTopics property.

Am I doing something wrong or does my popup file have to have the same name as the .hlp file I'm defining OnCreate of the form?

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

Unread post by Alexander Halser »

I have to check this out. Could be that we have a bug here in THelpRouter. The CHMPopupTopics property was earlier used to specify the internal text file for plain text popups (not mixed mode) to make THelpRouter compatible with other help authoring tools, too.

As a workaround, please use the same file name for the HLP popups as for the CHM file. You can change the popup HLP file name in Help & Manual in Project|Properties -> HTML Help. Just remove "_popup" from the file name.
Alexander Halser
Senior Software Architect, EC Software GmbH
mofnet
Posts: 5
Joined: Mon Jan 20, 2003 2:02 am

THelpRouter Creates AV

Unread post by mofnet »

I found another bug in the THelpRouter component, and I'm hoping to find a workaround. My shareware application has an initial nag screen that gives the user the option to accept the shareware terms or cancel the application from running. If the cancel button is clicked, the application is terminated. Since I changed the THelpRouter HelpType property to htMixedMode, the cancel button on my shareware form results in an AV. If I change the property to htWinHelp or remove the component from my main form, the application terminates normally.

Any clues or workarounds? Thanks.
mofnet
Posts: 5
Joined: Mon Jan 20, 2003 2:02 am

Unread post by mofnet »

I successfully implemented a workaround by freeing the THelpRouter on cancel of the application.
User avatar
Alexander Halser
EC-Software Support
Posts: 4098
Joined: Mon Jun 24, 2002 7:24 pm
Location: Salzburg, Austria
Contact:

Unread post by Alexander Halser »

Sounds as if you use an older version of EHS.

We changed one important detail regarding HTML Help and THelpRouter: previous versions used the main window handle of the application in the call to the HTML Help API. Version 1.40 does not. It rather uses 0 as the window handle. This results in a slightly different behaviour: the HTML Help browser window was always on top of the calling application when the window handle was used (this was the actual reason why we removed it) and the window handle was required for every help call, even for the call to close eventually opened help windows. I could imagine that if you terminate your application with HALT;, the help router crashes if it was initialized at this point.
Alexander Halser
Senior Software Architect, EC Software GmbH
Post Reply