context based help using chm file
I need to implement help to my VB6 project using a chm file.
have implemented the help and able to preview a content and index based help but don't know how to open the search page of the help file.
Here is the code which i am using
VB Code:
Private Declare Function HtmlHelp Lib "HHCtrl.ocx" Alias "HtmlHelpA" _
(ByVal hWndCaller As Long, _
ByVal pszFile As String, _
ByVal uCommand As Long, _
dwData As Any) As Long
Private Sub Contents_Click()
HtmlHelp hWnd, "help.chm", HH_HELP_CONTEXT, ByVal 100&
End Sub
Private Sub Index_Click()
HtmlHelp hWnd, "help.chm", HH_DISPLAY_TOPIC, ByVal "filesused.html"
End Sub
Can some one help me with the search option also.One more problem i am facing with my help page is that if i click on content it shows me the contents page in the help file but next time when i click index,it again shows me the contents page only.
Thanks
Re: context based help using chm file
Code:
Public Const HH_DISPLAY_TOC = &H1 ' Displays Table Of Contents
Public Const HH_DISPLAY_INDEX = &H2 ' Displays Index
Public Const HH_DISPLAY_SEARCH = &H3 ' not currently implemented
HtmlHelp hwndo, App.Path & "\PopUP\New\PU.chm", HH_DISPLAY_TOC, 0 ' Display TOC.
The TOC & Index commands work, the Search command bombs. Apparently the comment is true.
Re: context based help using chm file
i am not facing any problem with the TOC and index as it is working fine with the code below which i am using.The problem is that search is not working.
VB Code:
Const HH_DISPLAY_TOPIC As Long = &H0
Const HH_HELP_CONTEXT As Long = &HF
Private Sub Contents_Click()
HtmlHelp hWnd, "help.chm", HH_HELP_CONTEXT, ByVal 100&
End Sub
Private Sub Index_Click()
HtmlHelp hWnd, "help.chm", HH_DISPLAY_TOPIC, ByVal "filesused.html"
End Sub
I tried the code given by you but my VB exits with error when i use the code.
Can you help me with the search command
Re: context based help using chm file
I did a fairly thourough search of the forum and externally while seeking the dirty details of displaying text popup help. None of the sources I found exemplified the use of HH_DISPLAY_SEARCH. The comment attached to the constant declaration says that it is not implemented. It does not work for me, so I assume that you are out of luck. If there is a way to make it work, Opus should know about it.
You can let your users select the search tab from the navigation pane after they open the TOC.
Re: context based help using chm file
I now detect an error on my part. The last parm. should be 0, not 100, but changing it won't make a difference.
Re: context based help using chm file
This is what i have implememted it for users. When they select search they are directed to the TOC but i don't feel this is the right way to approach a problem but anyways thanks for your feedback.
Do you have idea about my second problem mentioned below as to how map the pages correctly. if i click on the content tab, contents page in the help file is displayed but next time when i click index tab,it again shows me the contents page only and viceversa.This is the same problem which you face in windows which displays the last accessible directory when you try to open a file.
Thanks,
Amit
Re: context based help using chm file
If the help file's tabs are misfiring, that is completely beyond my knowledge. I was assuming that you referred to clicking your program's help buttons. I put in a pm to the forum's html help expert. Perhaps he will jump in to save the day.
Re: context based help using chm file
Can someone help with the misfiring of help tabs and implementing search feature in help file
Amit