CppBuilderHelp

(C++ Builder) Creating and using a Help file

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. As topic ID's are mentioned and used multiple times, I've marked them in blue.



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
  1. define IDH_INTRODUCTION 100
  2. define IDH_OVERVIEW 200
  3. 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);
AnyIdValue has to be the number mapped to the topic ID. So not e.g. 'IDH_INTRODUCTION' but the value mapped to it ('100'). But you could also choose to #include the .MAP file to your project.

Have fun!





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 http://bdnqc.borland.com/wc/qcmain.aspx?d=10099 for the Borland Report.

Add to the main unit:
  1. include <WinHelpViewer.hpp>
  2. 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



last edited (August 29, 2007) by bilderbikkel

Back to the page