tags:

views:

83

answers:

3

Hi,

I am using Qt 4.6 so do C++.

I have a User Manual (.chm) for my application which has the help required for the users to run the application. Now I want this help to be integrated into my application, so that when the user selects for help from the application, the user manual will be opened with the corresponding help page displayed. In this way I can make use of the already available manual and users will find easy to probe through the document. (since it is familiar)

The user manual file is in the .chm format which has corresponding search keywords, which can be used to display the corresponding page when selected from the application. Just similar to F1 help in any of the windows application.

Is it possible to do this in Qt or C++? Or

What are the other ways through which the help can be integrated in the application?

Any pointers regarding this are welcome..

+2  A: 

Yes, it's possible. The help system infrastructure was designed to integrate with normal Win32 development in Visual Studio, but this is not technically necessary. Basically you just call HtmlHelp(GetDesktopWindow(), "Yourhelp.chm", HH_HELP_CONTEXT, IDYourCurrentContext);.

MSalters
Can you elaborate on HtmlHelp() function. Basically am used to Qt but the function does sound like a VC++ one.
liaK
It's not VC++ specific, but a general Win32 API function. Include Htmlhelp.h and link to Htmlhelp.lib (you get these by installing HTML Help workshop, but I presume you already have these if you made a .chm)
MSalters
Cool.. Is it possible for me to pass the value for Index item from this function so that it directly loads the desired page??
liaK
The precise value doesn't matter as long as your application and the .chm agree.
MSalters
A: 

try using libCHMxx or CHM lib along with Qt help system (see this sample)

agupta666
A: 

The more Qt way of Help Integration can also be done which is as follows.

The chm files are always opened by the hh.exe

So,

QProcess::execute("hh.exe D:/Manual.chm");

can be used to open the Manual.chm file from the application.

The command

QProcess::execute("hh.exe D:/Manual.chm::page1.htm");

will open the chm file with the page1.htm loaded. This will be helpful to load a specific help page in the chm file.

The only thing we must be aware in this approach is that we must have known the file name of the web pages (here page1.htm) previously..

Hope this one also helps... :)

liaK