Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


HtmlHelp stopped working

Posted on 2004-11-20
Medium Priority
Last Modified: 2013-12-25
For some reason, calling HtmlHelp has stopped working. Here
are some code snippets.  Any suggestion where to look will
be greatly appreciated. Code for WinHelp is also included
in case it interferes with htmlHelp (unlikely). WinHelp works fine.
Note:  HtmlHelp worked fine until I had a fatal HD failure and had
to restore from backup tapes.  Some of the code had to be rebuilt,
including this part. I could have easily done something wrong that
I cannot see.  

'*****************Code Snippets Follow*****************************
'Setting the help path in Sub Main:

   sHelpFile = App.Path & "\TSEPWin.hlp"
    HelpPath = App.Path & "\TSEPWin.chm"
    If osinfo.dwPlatformId = 1 And osinfo.dwMinorVersion = 0 Then
        UserInfo.HtmlHelp = False
        App.HelpFile = sHelpFile
        GoTo FinishHelpPath
    End If
    If UserInfo.HtmlHelp = False Then
        App.HelpFile = sHelpFile
        App.HelpFile = HelpPath & vbNullChar
    End If
    Load frmSplash
'Code from the HelpAndQuery module

      Public Const HH_DISPLAY_TOPIC As Long = 0
      Public Const HH_SET_WIN_TYPE = &H4
      Public Const HH_GET_WIN_TYPE = &H5
      Public Const HH_GET_WIN_HANDLE = &H6
      Public Const HH_DISPLAY_TEXT_POPUP = &HE      ' Display string resource ID or
                                                    ' text in a pop-up window.
      Public Const HH_HELP_CONTEXT As Long = &HF            ' Display mapped numeric value in
                                                    ' dwData.
      Public Const HH_TP_HELP_CONTEXTMENU = &H10    ' Text pop-up help, similar to
                                                    ' WinHelp's HELP_CONTEXTMENU.
      Public Const HH_TP_HELP_WM_HELP = &H11        ' text pop-up help, similar to
                                                    ' WinHelp's HELP_WM_HELP.

               Public Const HELP_CONTENTS = 3
               Public Const HELP_FINDER = 11

' Public variables
      Public lResult As Long
      Public sHelpFile As String
      Public lCommand As Long, lOption As Long
      Public HelpPath As String
      Public hwndHelp As Long


    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
    Declare Function WinHelp Lib "user32" Alias "WinHelpA" _
      (ByVal hwnd As Long, ByVal lpHelpFile As String, _
      ByVal wCommand As Long, ByVal dwData As Long) As Long

'Typical call:

   On Error GoTo ErrHandler
    If UserInfo.HtmlHelp = True Then
        hwndHelp = HtmlHelp(hwnd, HelpPath, HH_DISPLAY_TOPIC, 1000)
        lOption = 1000
        lResult = WinHelp(Me.hwnd, sHelpFile, lCommand, lOption)
    End If

    Exit Sub
'**********************End of Code Snippets**************************
Question by:rkulp
  • 2
  • 2
LVL 22

Accepted Solution

danaseaman earned 600 total points
ID: 12636837
Your code works here although I don't have TSEPWin.chm so changed code to:
Public Sub LoadHelp(ByVal hWnd As Long, ByVal HelpPath As String)
   hwndHelp = HtmlHelp(hWnd, HelpPath, HH_DISPLAY_TOPIC, 0)
End Sub

If that doeswn't work you can also try one of the following:
1. Manually register hhctrl.ocx(located in Windows\System32) using RegSvr32.
2. Reinstall HelpWorkshop from scratch.
LVL 22

Expert Comment

ID: 12636851
Also make sure you file App.Path & "\TSEPWin.chm" is indeed present and loads properly by DblClick in File Explorer .

Author Comment

ID: 12638539
Changing the call did not help.  The earlier version runs both help formats fine so hhcrtl.ocx is OK.  The last version was compiled under Windows 2000 and this is under Windows XP SP 2a.  Most of my user's problems and all the compiler questions came with service pack 2.

Author Comment

ID: 12650615
Please consider this question closed.  The problem was solved by two items:

1. Adding the following declare and load statement

Private Declare Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" (ByVal
lpLibFileName As String) As Long

  LoadLibrary "hhctrl.ocx"

These items solved an error code received when the program ended.  

2.  Changing the call to use HH_HELP_CONTEXT instead of HH_DISPLAY_TOPIC

These corrections were suggested by a Microsoft VB Team consultant.

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month13 days, 17 hours left to enroll

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question