Click to See Complete Forum and Search --> : HtmlHelp() API is not returning me anything


June 14th, 2000, 12:15 PM
I want to provide context-sensitive help for my application, for which I already have a Compiled HTML Help file(.chm). When I try making a call to the HtmlHelp() API it doesn't return me anything(returns 0).
On a form I have a textbox with certain HelpContextID. In the HTML help project I've associated a .htm file with this ID.
I used the following piece of code to acheive this.

private Sub Text2_KeyUp(KeyCode as Integer, Shift as Integer)
Dim hwndHelp as Long
If KeyCode = vbKeyF1 then
'The return value is the window handle of the created help window.
hwndHelp = HtmlHelp(hWnd, App.Path & "\HelpXSLEditor.chm", HH_HELP_CONTEXT, Text1.HelpContextID)
End If
End Sub



In the module(.bas) file in my VB Project, I added the following code :

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

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