Discussion:
hhctrl.ocx HtmlHelpA not working
(too old to reply)
Rich
2003-08-22 07:54:04 UTC
Permalink
In VB6, I'm having a problem loading a .chm file using the API.

If you press F1, the help file will load. But it will NOT load if you
call the API, until after you have pressed F1... its like it isn't being
initialized until you hit F1. And I even tried LoadLibrary but that
still doesn't work.

Public 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

Public Declare Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA"_
(ByVal lpLibFileName As String) As Long
Ulrich Kulle [DE]
2003-08-22 16:37:31 UTC
Permalink
Hi Rich,
Post by Rich
In VB6, I'm having a problem loading a .chm file using the API.
If you press F1, the help file will load. But it will NOT load if you
call the API, until after you have pressed F1... its like it isn't being
initialized until you hit F1. And I even tried LoadLibrary but that
still doesn't work.
Public 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
Public Declare Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA"_
(ByVal lpLibFileName As String) As Long
try to get work the following module:
http://www.help-info.de/en/Visual_Basic/vb_context-id.htm

Do you want to press first F1 by the user and then click a button to call
help?

For further information check the links at:
http://www.help-info.de/en/Visual_Basic/vb.htm

Best regards
Ulrich Kulle
-----------------------------------------------------------
Hannover, Germany
http://www.help-info.de
-----------------------------------------------------------
Dave Liske
2003-08-22 19:26:23 UTC
Permalink
Hi Rich,

API calls are case-sensitive in VB, and LoadLibrary doesn't work at all.
Here's all you need:

Private Declare Function HTMLHelp Lib "hhctrl.ocx" _
Alias "HtmlHelpA" (ByVal hWnd As Long, _
ByVal lpHelpFile As String, _
ByVal wCommand As Long, _
ByVal dwData As Long) As Long

You may want to download my HTML Help class module
(http://www.mvps.org/htmlhelpcenter/htmlhelp/hhvbclas.html). It contains all
the most-used functions.

Dave
Microsoft Help MVP since 1999
http://www.mvps.org/htmlhelpcenter
Post by Rich
In VB6, I'm having a problem loading a .chm file using the API.
If you press F1, the help file will load. But it will NOT load if you
call the API, until after you have pressed F1... its like it isn't being
initialized until you hit F1. And I even tried LoadLibrary but that
still doesn't work.
Public 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
Public Declare Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA"_
(ByVal lpLibFileName As String) As Long
Loading...