Creating Help Files in VB6 ?

Nagual
06-03-2002, 03:38 PM
I am a pretty new to programming and to visual 6, I have used the HTML help workshop to create a small help file and want to use it in my programs but do not know how to insert it or use it in the programs.... I know this is probably really stupid of me but I need help.....

BillSoo
06-03-2002, 03:46 PM
I don't use HTML workshop, but in general, you set the HelpContextID property of various controls. When that control has the focus, pressing the F1 key will call up the help file with the topic referenced by HelpContextID displayed.

I think you will also need to load the help file during your main startup with app.helpfile etc.

Nagual
06-03-2002, 03:51 PM
Thanks, but thats not what I need just now, what I'm looking for is probably even simpler - how to access (in a drop down menu) a help file, which will have the usual contents/index etc... ?

Flyguy
06-03-2002, 04:04 PM
Have a look at the HTML Help Center (http://www.mvps.org/htmlhelpcenter/)

Thinker
06-03-2002, 04:07 PM
Actually, what you want to do is surprisingly difficult. It requires
the use of some API calls that can be quite buggy (in NT as least).
Here are the basics...

Private Const HH_DISPLAY_TOPIC = &H0
Private Const HH_HELP_CONTEXT = &HF
Private Const HH_CLOSE_ALL = &H12

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

Private Sub mnuHelpHelp_Click()
Dim hwndHelp As Long

hwndHelp = HtmlHelp(Me.hWnd, App.HelpFile, HH_HELP_CONTEXT, ByVal Me.HelpContextID)
End Sub

Private Sub Form_Unload(Cancel As Integer)
HtmlHelp Me.hWnd, "", HH_CLOSE_ALL, 0&
End Sub

Nagual
06-03-2002, 04:39 PM
Thanks!, as I said I was pretty new to VB6 and programming in general so I won't pretend to understand every thing you said , some of it yes, all of it no! I'll try to use it and see what errors it throws up at me.

In the mean time if any one has any great ideas or solutions please free free to pass them this way!...

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum