The error I am getting is "No context-sensitive help installed". I think I
may not have the HTMLHelpViewer unit added properly.
Searching the help I can't find any relevant info or examples.
Can anyone help?
> I am a Delphi programmer trying to learn C++. Right now I am trying
> to add HTML help to a simple BDS2006 C++ Win32 app. I already
> created the .chm file and can call it from a Delphi app, but so far I
can't
> figure out how to do it in C++.
How are you calling it in Delphi? The VCL is the same in both Delphi and
C++, so the approach should be the same.
> The error I am getting is "No context-sensitive help installed".
What EXACTLY are you doing to reproduce that?
Gambit
To simplify the problem I did the following:
Step by step Delphi:
Open HelpScribble (my help editor).
- Create a new help project, type = html help, name = test.chm
- Add a topic:
ID: 10
Title: Help Test
Body: The quick brown fox...
- Compile and save help project.
- Open BDS2006
- Create a new Delphi VCL forms app for Win 32 (PHelpTest.bdsproj)
- Set Project | Options | Help File = test.chm
- In the main form property editor set HelpContext = 10
- Add HTMLHelpViewer to the uses clause:
uses
Forms,
HTMLHelpViewer,
Pmain in 'Pmain.pas' {Form1};
- Click run.
- When the form appears press <F1> and magic! the help appears.
Step by step C++:
- Create a new C++ VCL forms app for Win 32 (CHelpTest.bdsproj)
- Set Project | Options | Help File = test.chm
- In the main form property editor set HelpContext = 10
- Add the include:
#include "HTMLHelpViewer.hpp"
- Click run.
- When the form appears press <F1> and instead of help you get an
exception and error dialog "No context-sensitive help installed".
That's about as simple as I can make it.
There must be more to than just including the hpp file. Does it need
some init call or something?
THE SOLUTION:
Step by step Delphi:
Open HelpScribble (my help editor).
- Create a new help project, type = html help, name = test.chm
- Add a topic:
ID: 10
Title: Help Test
Body: The quick brown fox...
- Compile and save help project.
- Open BDS2006
- Create a new Delphi VCL forms app for Win 32 (PHelpTest.bdsproj)
- Set Project | Options | Help File = test.chm
- In the main form property editor set HelpContext = 10
- Add HTMLHelpViewer to the uses clause:
uses
Forms,
HTMLHelpViewer,
Pmain in 'Pmain.pas' {Form1};
- Click run.
- When the form appears press <F1> and magic! the help appears.
Step by step C++:
- Create a new C++ VCL forms app for Win 32 (CHelpTest.bdsproj)
- Set Project | Options | Help File = test.chm
- In the main form property editor set HelpContext = 10
- Add the include and link:
#include "Cmain.h"
#include "HTMLHelpViewer.hpp"
//------------------------------------
#pragma package(smart_init)
#pragma link "HTMLHelpViewer"
#pragma resource "*.dfm"