Problem
I am using Embarcadero C++ Builder XE. I am trying to trigger the opening of a help file (*.chm), when the user presses the F1 button on their keyboard. I thought I had done everything correctly, but I get no response/action when F1 is pressed.
What I did:
I have created a .chm help file (using Microsoft HTML Help Workshop). I have copied the compiled .chm file to the application directory. I have set:
Application->HelpFile = "My_Help.chm";
In the main form, I have set the HelpFile property to the same .chm file.
In the main form I have included the following two lines of code:
#include "HtmlHelpViewer.hpp"
#pragma link "HTMLHelpViewer"
The confusing thing is: I had this working a few weeks ago, and subsequently 'lost' the code :(
And since then, when I went to recreate the solution, I have had no success.
Also
If I define a help button, as detailed here ( embarcadero ), still nothing happens.
However, if I attach the following code to a button, the help file DOES open:
Application->HelpContext(0);
Question
Has anybody any idea why this would have worked before, but now it doesn't? Perhaps there is a simple step I did in the past and have forgotten, but I have searched all the help on this that I can find (including here at helpscribble), and covered all the steps as I see it. Any help would be much appreciated.
(I tried posting on the Embarcadero forums but that is a complete waste of time at the moment)