Hooking up help in Visual FoxPro

In order to use a CHM help file in your applications a few steps are required. Specifically for deployed applications you need to ensure you ship the proper files with your application as Visual FoxPro has no native CHM support and uses a couple of support COM objects to provide this interface.

Including Setup files

Visual FoxPro doesn't have direct native support for CHM files and requires a couple of support COM objects. They are:

  • Foxhhelp9.exe
  • foxhhelpps9.dll

Both are COM objects and need to be registered. If you're using an MSI style installer you need to include the VFP9HTMLHelp (or VFP8) merge module.

  • VFP9HTMLHelp.msm

This will give you basic CHM support for your application.

Hooking up Help for the Application

To hook up help in your application you need to:

SET HELP TO YourHtmlHelp.chm

Now pressing F1 should bring up your help file and generically pop up your help file. If there's no active Help Context Id, you'll get the home/index topic of the help file.

If you want to pop a specific topic you can do so by it's Help Context Id:

HELP ID 4

Finally you can pop up Help based on HelpContextId values applied to specific controls in FoxPro forms. HelpContextIds are hierarchical and work from the inner controls up the container hierarchy all the way to the form level and in essence VFP does a HELP ID with that context id for you.

So if you sit on TextBox1 and it has a HelpContextId set it will pop up that topic. If TextBox1 does not have a HelpContextId set FoxPro walks up to the immediate container and checks its HelpContextId, so if you have PageFrame on the page and the active page has a HelpContextId that topic is shown for example. FoxPro walks all the way up to the form and if it doesn't find any container with a HelpContextId it pops up the currently active topic if the help file was already open or reopens it with the default topic selected. The same occurs if you have provided a HelpContextId that doesn't exist.

Help Builder can help you hook up HelpContextId values through the Visual FoxPro IDE Hooks at designtime.

See also

Visual FoxPro IDE hooks to Help Builder

© West Wind Techologies, 1996-2023 • Updated: 08/12/15
Comment or report problem with topic