i need help creating a html help file to add to my program. do i need to create a simple html file or files and then link does to the prog. or do i need to convert them into .chm files to link to the prog.
One method to contemplate, if you are not concerned about your help being context sensitive is to use the ShellExecute API to launch an HTML page from your VB app. I have typically placed the name and path of the html page in an ini file (or in the registry) just in case I later wish to change it. This method allows me (or even the user) to update the help files quickly and easily after the application has been released.
The page that is launched is typically laid out as a Table of Contents where references (links to other pages) can easily be added, deleted or modified. Users seem to enjoy this method as they can even add their own Tips and How To Do’s after the application has been released.
If this method is of interest I have placed some sample code:
----------------------INI FILE ---------------------
This assumes you have an ini file called AppName.ini
Minimum contents of the ini file would be:
-------------------- VB App -------------------------
------ Cut and paste the following into VB form -----
'This is the API to launch other programs / files
Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
'This is the API to read an ini file
Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long
Private Sub mnuHelpDocs_Click()
Dim Temp As String * 300
Dim ReadLine As Integer
Dim HelpDoc As String
Dim MyIni As String
'Get Help File Name and Path from INI File
MyIni = App.Path & "\AppName.ini"
ReadLine = GetPrivateProfileString("Help Documentation", "Help_Location", App.Path & "\Help_Start.htm", Temp, Len(Temp), MyIni)
HelpDoc = Left$(Temp, Len(Temp))
'Launch the Help File
ShellExecute hwnd, "open", HelpDoc, vbNullString, vbNullString, conSwNormal
End Sub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.