Implementing context-sensitive help file in VB6
Posted by scmay on July 13, 2007
I have been implementing context-sensitive help in the system, realizing that the original Help button doesn’t do much when it just pops up at the Welcome section of the Help file.
Help-info gives clear detailed instructions how to do so. If you still do not understand it, there’s even a downloadable for you to explore (the only downside is that you cannot see the source of the .chm file)
I quote the function that I used which is found in the source of Help-info downloadables
Public Sub ShowTopicID(ByVal intHelpFile As Integer, IdTopic As Long)
HtmlHelp hwnd, HFile(intHelpFile), HH_HELP_CONTEXT, IdTopic
End Sub
However, after implanting all context sensitive help, I run into the error “there is not enough memory available for this task” when I click some of the Help buttons (not all). When you click OK, the entire system shuts down. Hrmp! I know it will stun our users as much it stuns me the 1st time it did that to me, so I had to find a fix.
I googled and found that it was a bug found in Microsoft and there was only one post found regarding suggested solutions
The solution specified here is to create an ‘out of process’ or use NetHelp context sensitive. However, NetHelp requires Netscape Navigator. And I didn’t know how to create an out-of-process program.
The quick fix?
I went back to the sample program mentioned earlier, and found that in ShowTopic function it uses a different library. I implemented the ones which crashed with ShowTopic function and it works perfectly!
I quote the portion of function of ShowTopic (notice that it uses HTMLHelpTopic)
Public Sub ShowTopic(ByVal intHelpFile As Integer, strTopic As String)
HTMLHelpTopic hwnd, HFile(intHelpFile), HH_DISPLAY_TOPIC, strTopic
End Sub


How to Get Six Pack Fast said
If you ever want to hear a reader’s feedback
, I rate this article for four from five. Decent info, but I just have to go to that damn yahoo to find the missed bits. Thanks, anyway!