WinHelp to HTMLHelp for Visual Basic

630 Views Asked by At

I have inherited an old Visual Basic project. It still works except for the .hlp file on Windows 10.

I have found how I can convert the .hlp file to .chm.

Can anyone tell me how to replace the WinHelp with HTMLHelp in the VB project?

Thanks in advance

2

There are 2 best solutions below

0
On

I have had success getting the Setup to install the WinHlp32 modules. I had to add some extra code into the Setup to get the modules to register.

I have only tried this on a couple of machines so far...

Thanks for your help.

3
On

A correct answer depends on your exact requirements.

If you only want to start the old *.exe and display the *.hlp file (WinHelp) please navigate to the following link (search for Run WinHelp on Windows10) and read all further links inside:

Please note a tool called HHPMod especially for migrating context-sensitive F1 help. If F1 help has been used intensively in your old project, it can be difficult to switch from WinHelp (.hlp) to HTMLHelp (.chm).

But, you're already on the right track recommended ten years ago and still valid today "Help authors should move over to HTML Help 1.x (.chm)".

If you really want to recompile your old project then Download Visual Basic 6 example project may help you (see Download section).

First of all, you need to specify the help file that you want to use by setting e.g.:

App.HelpFile = App.Path & "\helpfile.chm"

You'll find all declarations in a module modHelp.bas like e.g.

Private Declare Function HtmlHelp Lib "hhctrl.ocx" Alias "HtmlHelpA" _
            (ByVal hwndCaller As Long, ByVal pszFile As String, _
            ByVal uCommand As Long, ByVal dwData As Long) As Long

Private Declare Function HTMLHelpTopic Lib "hhctrl.ocx" Alias "HtmlHelpA" _
             (ByVal hwndCaller As Long, ByVal pszFile As String, _
            ByVal uCommand As Long, ByVal dwData As String) As Long

Private Declare Function HtmlHelpSearch Lib "hhctrl.ocx" Alias "HtmlHelpA" _
            (ByVal hwndCaller As Long, ByVal pszFile As String, _
            ByVal uCommand As Long, dwData As HH_FTS_QUERY) As Long

Private Declare Function HtmlHelpIndex Lib "hhctrl.ocx" Alias "HtmlHelpA" _
            (ByVal hwndCaller As Long, ByVal pszFile As String, _
            ByVal uCommand As Long, dwData As HH_AKLINK) As Long

For further information see also Using a module for Visual Basic 6 projects