Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29273 Discussions

HTML help - press F1 for help - advice needed

davidgraham
Beginner
826 Views
I have converted my WinHelp to HTMLhelp and it works OK.
I now need to get the bit where you press F1 and the correct help page is displayed.
I have the call -
lret=HTMLhelp (hWndMain,lpszHelp,HH_HELP_CONTEXT,MapNum)
Where MapMum is a number for a specific help page.
When I press F1 I get the message "HH_HELP_CONTEXT called without [MAP] section".
I have tried to find how I create a MAP section but to no have not been able to.
The Help for HTML help mentions a .h file, Visual Fortran has one, but I don't see how that is used by HTML help.
Does any one use HTML help that could offere some advice?
Thanks
David
0 Kudos
3 Replies
Jugoslav_Dujic
Valued Contributor II
826 Views
You need the following lines in your .hhp file:
[ALIAS]
#include Alias.h
[MAP]
#include HelpID.h

The Alias.h file should be located in the same directory as .hhp andhave the following form:
IDH_1=DirPage1.htm
IDH_2=DirPage2.htm
IDH_2_1=DirPage21.htm
while the HelpID.h should contain #defines of these constants, e.g.
#define IDH_1 1000
#define IDH_2 1010
#define IDH_2_1 1020

also, you need translation of the former to Fortran in order to include it in your project. "resource.hm" file generated by VS resource editor can serve instead of HelpID.h -- you need only towrite the Alias.h yourself.
Jugoslav
0 Kudos
davidgraham
Beginner
826 Views

Thanks,

That worked, I have used both an alias.h & helpID.h file.

David

0 Kudos
Jugoslav_Dujic
Valued Contributor II
826 Views
Note that resource.hm enables you to semi-automate entire process. When you check "help ID" for a control in resource editor, file called resource.hm is automatically generated, containing a unique ID for every control accross the project. That same ID is passed to you as part of HELPINFO structure on WM_HELP. If you use that resource.hm as map file during HtmlHelp compilation, you can simply pass whatever HELPINFO.dwContextID you receive to HtmlHelp API without a tedious select case statement (you don't even need to translate it to Fortran).
(I guess that resource.h could and HELPINFO.iCtrlID could be used for the same purpose, but these IDs are not guaranteed to be unique).
Jugoslav
0 Kudos
Reply