HtmlHelp stopped working

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
    Else
        App.HelpFile = HelpPath & vbNullChar
    End If
FinishHelpPath:
    Load frmSplash
    frmSplash.Show
   
'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


'Declares

    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)
    Else
        lOption = 1000
        lResult = WinHelp(Me.hwnd, sHelpFile, lCommand, lOption)
    End If

    Exit Sub
'**********************End of Code Snippets**************************
LVL 1
rkulpAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

danaseamanCommented:
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.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
danaseamanCommented:
Also make sure you file App.Path & "\TSEPWin.chm" is indeed present and loads properly by DblClick in File Explorer .
0
rkulpAuthor Commented:
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.
0
rkulpAuthor Commented:
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.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.