Integrating Help *.chm files in FORTRAN applications
I'm about to embark in creating a help system for my application. Most current help compilers create HTML Help files
(*.chm) whereas previously WinHelp (*.hlp) files were the norm. Apparently the support for Winhelp (*.hlp) has been
withdrawn by Microsoft with the advent of Vista. Although you can still download the WinHelp I prefer to use the current
format. My question is how do you call up the HTML format help files from within a windows application. The Generic
sample provided still utilises the WinHelp API function which does not recognise HTML files.
| |
Re: Integrating Help *.chm files in FORTRAN applications
I'm about to embark in creating a help system for my application. Most
current help compilers create HTML Help files (*.chm) whereas previously WinHelp (*.hlp) files were the norm. Apparently
the support for Winhelp (*.hlp) has been withdrawn by Microsoft with the advent of Vista. Although you can still
download the WinHelp I prefer to use the current format. My question is how do you call up the HTML format help files
from within a windows application. The Generic sample provided still utilises the WinHelp API function which does not
recognise HTML files.
Add the attached .lib file to your project. Use this interface:
INTERFACE
FUNCTION HtmlHelp (hWndMain, lpszHelp, uCommand, dwData)
USE ifwinTY
integer(BOOL) :: HtmlHelp ! BOOL
!DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'HtmlHelpA' :: HtmlHelp
integer(HANDLE) hWndMain ! HWND hWndMain
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpszHelp
character*(*) lpszHelp ! LPCSTR lpszHelp
integer(UINT) uCommand ! UINT uCommand
integer(ULONG_PTR) dwData ! ULONG_PTR dwData
END FUNCTION
END INTERFACE
and then your procs will need to process WM_HELP in the message loop handler:
CASE (WM_HELP)
rval = HtmlHelp (ghwndmain, helppathname, HH_DISPLAY_TOPIC, NULL)
| |
Re: Integrating Help *.chm files in FORTRAN applications
Add the attached .lib file to your project. Use this interface:
INTERFACE
FUNCTION HtmlHelp (hWndMain, lpszHelp, uCommand, dwData)
USE ifwinTY
integer(BOOL) :: HtmlHelp ! BOOL
!DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'HtmlHelpA' :: HtmlHelp
integer(HANDLE) hWndMain ! HWND hWndMain
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpszHelp
character*(*) lpszHelp ! LPCSTR lpszHelp
integer(UINT) uCommand ! UINT uCommand
integer(ULONG_PTR) dwData ! ULONG_PTR dwData
END FUNCTION
END INTERFACE
and then your procs will need to process WM_HELP in the message loop handler:
CASE (WM_HELP)
rval = HtmlHelp (ghwndmain, helppathname, HH_DISPLAY_TOPIC, NULL)
Thanks Paul,
Where are HH_DISPLAY_TOPIC and other such constants defined?
| |
Re: Integrating Help *.chm files in FORTRAN applications
Thanks Paul,
Where are HH_DISPLAY_TOPIC and other such constants defined?
! HTML help command flags
INTEGER, PARAMETER :: HH_DISPLAY_TOPIC = #0000
INTEGER, PARAMETER :: HH_DISPLAY_TOC = #0001
INTEGER, PARAMETER :: HH_DISPLAY_INDEX = #0002
INTEGER, PARAMETER :: HH_DISPLAY_SEARCH = #0003
INTEGER, PARAMETER :: HH_KEYWORD_LOOKUP = #000D
INTEGER, PARAMETER :: HH_DISPLAY_TEXT_POPUP = #000E
INTEGER, PARAMETER :: HH_CLOSE_ALL = #0012
| |
Re: Integrating Help *.chm files in FORTRAN applications
! HTML help command flags
INTEGER, PARAMETER :: HH_DISPLAY_TOPIC = #0000
INTEGER, PARAMETER :: HH_DISPLAY_TOC = #0001
INTEGER, PARAMETER :: HH_DISPLAY_INDEX = #0002
INTEGER, PARAMETER :: HH_DISPLAY_SEARCH = #0003
INTEGER, PARAMETER :: HH_KEYWORD_LOOKUP = #000D
INTEGER, PARAMETER :: HH_DISPLAY_TEXT_POPUP = #000E
INTEGER, PARAMETER :: HH_CLOSE_ALL = #0012
Thanks again! Everything works fine now.
| |
Re: Integrating Help *.chm files in FORTRAN applications
Thanks again! Everything works fine now.
Uh Oh. I spoke too soon. I have got the 32-bit version to work but the 64-bit configuration will not link.
"Unresolved external symbol HtmlHelpA". Does the interface need some tweaking for 64-bit applications?
| |
Re: Integrating Help *.chm files in FORTRAN applications
To dannycat
function
HtmlHelpA (_HtmlHelpA@16) is realized in file 'hhctrl.ocx'. Try to search similar file. I don't know why in Fortran the names of dlls is
hidden from user. In Delphi for example you can make so:
function HtmlHelp(
HwndCaller: hwnd;
pszFile: string;
uCommand: integer;
dwData: integer): hwnd; stdcall; external 'hhctrl.ocx'
name 'HtmlHelpA';
| |
Re: Integrating Help *.chm files in FORTRAN applications
I don't work in 64bit, but I suspect that htmlhelp.lib may only contain 32-bit versions of the API functions, so
that when your code has flexible defines such as INTEGER(HANDLE) which automatically track 32/64 bits, your calling
code's Interface will then differ from the actual library routine. You will probably have to locate a 64-bit version
of the library (which I am unable to supply).
| |
Re: Integrating Help *.chm files in FORTRAN applications
function HtmlHelpA (_HtmlHelpA@16) is realized in file 'hhctrl.ocx'. Try to search similar file. I don't know
why in Fortran the names of dlls is hidden from user.
Eye Glasses | |
Re: Integrating Help *.chm files in FORTRAN applications
Thanks everyone, I've found the library I need in the SDK area.
C:Program
FilesMicrosoft SDKsWindowsv6.0ALibx64
| |
Re: Integrating Help *.chm files in FORTRAN applications
function HtmlHelpA (_HtmlHelpA@16) is realized in file 'hhctrl.ocx'. Try
to search similar file. I don't know why in Fortran the names of dlls is hidden from user.
I am using Windows 7 (64 bit version) and the latest Intel Fortran on top of Microrosft Visual Studio 2008. I have the same problem of not being able to link my project because of the HtmHelpA missing.
I need
further information about how to link my project successfully. Can you help ?
Best regards, f8
| | |