Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

 

 

(C++) Creating and using help files in C++ Builder

 

To create and use a Help file takes the eleven steps below. Every step is short and easy and once you've taken all steps, you can easily add more stuff to your help file. I've described the way to make a simple browsable help file.

 

 

 

 

 

1) Starting Microsoft Help Workshop

 

The file can be found at '\CBuilder6\Help\Tools\HCW.EXE'.

 

2) Create a .HPJ file

 

 

 

 

 

 

3) Create a .CNT file

 

 

 

 

 

 

4) Adding the .CNT file to the .HPJ

 

 

 

 

 

 

5) Create a .RTF file

 

 

 

 

 

 

6) Adding the .RTF file to the .HPJ

 

 

 

 

 

 

7) Create a .MAP file in any text editor

 

 

//Example
#define IDH_INTRODUCTION 100
#define IDH_OVERVIEW 200
#define SUMMARY 300

 

 

 

 

 

8) Adding the .RTF file to the .HPJ

 

 

 

 

 

 

9) Create a Help file window with browsing abilities

 

 

 

 

 

 

10) Compile the .HLP file

 

 

 

 

 

 

11) Connect these files to C++ Builder

 

Application->HelpSystem->ShowContextHelp(AnyIdValue,Application->HelpFile);

 

 

 

 

 

 

Errors in compiling

 

HC5011: Cannot open the file [someJunk]

 

The complete error message is:

 

HC5011: Error: C:\Program Files\Borland\CBuilder6\Projects\Simulations\ThorVeen\7\ProjectThorVeenHelpRtf.rtf :

Cannot open the file "{\rtf1\ansi\ansicpg1252\uc1 \deff0\deflang1033\deflangfe1033{\fonttbl{\f0\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman."

 

I solved it by changing the filename 'ProjectThorVeenHelpRtf.rtf' in Windows Explorer (by adding a '2' in the end, changing it to 'ProjectThorVeenHelpRtf2.rtf'). Then it works! Strange though...

 

 

 

 

 

Bug in Help System and VCL

 

 

When using VCL and C++ Personality in Borland Developer Studion 2006:

 

This an undocumented bug in the Automated Help System. This came from the original Forms.pas and so the bug was inherited. See this page for the Borland Report.

 

Add to the main unit:

 

#include <WinHelpViewer.hpp>

#pragma link WinHelpViewer

 

Set the Help file at at either design time or at run time. To set the Help file at design time, do 'Project->Options'.

 

To set the Help file at run time, use the line below:

 

Application->HelpFile = "C:\\HelpFile.hlp";

 

With this you only have to set the HelpContext or HelpKeyword on the Control/Forms property and your help will be activated.

 

 

 

 

 

External links

 

 

 

 

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict

This page has been created by the tool CodeToHtml