HTML Help for Windows VC++

Last modified: 27 May 1998.

Page Contents Setting up a HTML-based help system  Web pages for dialog boxes  Contents Page  Pop-up context help boxes  Other web pages

Using Hi HelpIndex and Hi Help in your product

The Hi HelpIndex Developer licence includes the necessary software to enable you to set up HTML-based help for your Windows Visual C++ MFC programs. This includes showing "What's This" style help in pop-up boxes. And the pop-up boxes can be shown from your help pages as well (as long as they are being viewed by Hi Help).

For an example of this, simply try Hi Lab. Make sure that you have Internet Explorer loaded.

The Hi HelpIndex help system often requires that users have more than 16MB in Windows 95 or 98 systems. However, please check the memory requirements for your application.

Setting up a HTML-based help system

The main help engine is Hi Help. This executable is provided as a part of Hi HelpIndex.

This has a defined interface which can be used from many development environments. However, tools and instructions are only available for Visual C++ MFC at the moment.

Contact our support desk for a copy of the necessary VC++ MFC source code. This intercepts the normal calls to WinHelp, and diverts them as necessary to Hi Help. If Internet Explorer is not loaded then it calls WinHelp as normal, so you should provide a basic ".hlp" file as a backup.

You still need to run the standard Microsoft MAKEHELP.BAT command to build a ".hm" file for your project. You must include this file in your release distribution; this is how the help system knows which web page to load.
Include the following lines in MAKEHELP.BAT if you want pop-up help identifiers for controls.

   echo // Controls (IDC_*) >>"hlp\YourApp.hm"
   makehm IDC_,HIDC_,0x50000 resource.h >>"hlp\YourApp.hm"

Please read Microsoft's VC++ Technical Note 28 on MFC Context-Sensitive Help Support.

Assuming you want to show pop-up help for the standard MFC ids, copy DevStudio\VC\MFC\Include\AFXHELP.HM to the same directory as your executable, and copy PHD's AfxHelp.htm pop-up text to your help web page directory. This is loaded automatically by Hi Help once you have asked it to load your .hm file. You may wish to customise AfxHelp.htm for your application.

Web pages for dialog boxes

For each resource in your project, you can write a help web page. For example for a dialog IDD_OPTIONS you should write an HTML page IDD_OPTIONS.htm. Hi Help always assumes a .htm. file extension.

You can also write any number of other web pages to supplement the basic resource pages. Just provide HTML links as normal.

Contents Page

You should also write a web page, eg called Contents.htm, which should call up Hi HelpIndex. You tell Hi Help the name of this file. Hi Help displays this page when its Contents button is pressed.

Once you have written all your help web pages, make a suitable help index file for use by the Contents page.

Pop-up context help boxes

You will have other identifiers used in your project, eg beginning with IDC_, IDM_ and IDS_. These can be associated with full web pages, as described above, or - more usefully - displayed as a small pop-up help box.

The are several ways in which context-sensitive help appears:

The pop-up text for all these identifiers is put in one (or more) web pages. You tell Hi Help the name of this pop-up page.

The text for a particular identifier starts with an anchor tag and ends with a horizontal rule tag. For example, here is a pop-up for identifier IDC_ADD:

   <A NAME="IDC_ADD"></A>
   Press the <B>Add</B> button to add an entry to the list.<P>
   This button may be disabled.
   <HR>
 And this is how it will appear.

 Several HTML tags are supported.
You can define a pop-up for two identifiers at the same time by adding in an extra anchor name tag.

The BODY BGCOLOR and TEXT attributes determine the default background and foreground text colours of the pop-up. Set BASEFONT FACE and SIZE attributes before the Default anchor to set the default font name and size.

Add a pop-up entry with an identifier name of Default to specify the text that is shown when a matching id cannot be found. The text has the id number and name appended.

  <A NAME="Default"></A>
  Please contact PHD<P>
  Sorry, no help available for id
  <HR>

You can have links to pop-ups in your main web pages. For example a link to the IDC_ADD add pop-up would be <A HREF="popup:IDC_ADD">Add button</A>.
Hi Help will display the pop-up correctly.

Other web pages

Say you have a menu option Help+Welcome which you want to display a web page.

Make this handler call AfxGetApp()->WinHelp(HID_BASE_RESOURCE+IDR_WELCOME,HELP_CONTEXT). (You will need to include AfxPriv.h to reference HID_BASE_RESOURCE.) From VC++'s View+Resource Symbols... add a new symbol called IDR_WELCOME, say with value 50. A suitable range of id values for such symbols is 50 to 99 as they do not conflict with any other ids defined. Write IDR_WELCOME.htm and check it is displayed.

Future Plans
We intend to write a Developer Studio Add-in to automate the process of adding a Hi Help help system to your project.

We plan to get rid of the need to have Internet Explorer loaded. If it is not there, then our own mini-web browser will display your help page as best it can.

We hope that the pop-up context help boxes will support images (GIF or perhaps just BMP) and hypertext links soon.


HelpIndex    PHD