Results 1 to 32 of 32

Thread: Still the darn Context sensitive Help [RESOLVED]

  1. #1

    Thread Starter
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863

    Talking Still the darn Context sensitive Help [RESOLVED]

    I have done all the .topic stuff, included the *.txt and *.h file into the Help.chm. I have all controls with the correct WhatsThisHelpID.
    But during runtime i only get the complete helpfile shown using
    VB Code:
    1. Shell "hh SubHunterHelp.chm", vbNormalFocus
    If I'm trying the select a control with the QuestionMark mousepointer (that is trying to get the context help pop-up) I only get the message that the file: "d:\folder\SubHunterHelp.chm" can't be opened.
    What am I doing wrong?
    Last edited by opus; Dec 11th, 2002 at 01:19 PM.
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

  2. #2
    Addicted Member
    Join Date
    Aug 2002
    Location
    Michigan
    Posts
    181
    Dear Opus,
    To make it work that way, switch to C++. VB does not accept the #include directive!
    Use Notepad for these tasks, do not attempt this in the Workshop!

    Construct an [ALIAS] section in the .hhp
    file with an entry for each topic listing
    the htm file containing the topic

    IDH_Form = Form.htm

    Delete the .h file from the [MAP] section
    and place the map segment directly:

    #define IDH_form 1010

    Reference: Knowledge Base 189453
    I have used this method, and it works!

  3. #3
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  4. #4

  5. #5

    Thread Starter
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863
    I'm just trying to show to pop-up contxt-sensitive help (like the tooltip).
    For the complete Help I'm using the HTML-Help workshop and it works.
    I'll try Ben's way next monday (no hardcoding on a weekend )
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

  6. #6
    Addicted Member
    Join Date
    Aug 2002
    Location
    Michigan
    Posts
    181
    Opus, the method I am using opens the regular help window and displays your topic with the navigation pane and everything. I have not been able to figure out how to make it do the regular popup multiline tool tip trick! The documentation I have found on that was too ambiguous!
    There are window settings that should make it do what you want, but I could not figure out how to implement them when I experimented with it.

  7. #7
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431
    opus: If you will send me your email address, I have a demo project that I can send you that uses just regular VB to do context sensitive help. I can't attach it since the help file it uses is from a large commercial app and even zipped it is too large.

  8. #8

    Thread Starter
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863

    Talking

    I got it now!
    The only thing that is needed in VB 6.0 to display those Yellow Messages (after selecting the "?" and clicking on a control) is this line in Form_load:

    VB Code:
    1. App.HelpFile = "Help.chm::/ContextSensitiveHelp.txt"
    where Help.chm is the compiled HTML-Help file, which consists the file ContextSensitiveHelp.txt. The later holds all the lines like

    VB Code:
    1. .topic IDH_CONTROL1
    2. Message in the yellow box.
    Thanks to you all for the help.
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

  9. #9
    Addicted Member
    Join Date
    Aug 2002
    Location
    Michigan
    Posts
    181
    Dear Opus,
    Thank you for sharing this valuable information. I am hungry for more detail.
    I had tried a similar context from another tutorial I found. It did not work. I was expecting the topic file to be compiled into the .chm. As near as I can determine, it is not. Does it somehow ride along externally? Do you have to include it separately?

    What pops up when you hit F1 : the compiled html topic or the topic from the text file???

  10. #10

    Thread Starter
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863
    Hi Ben,
    For me it worked like this:
    BTW I'm using the standard Microsoft HTML Help Workshop.

    I created one HTM file, that holds the complete HelpInformation that is displayed when opening the the HelpWindow.
    The part with the ContextSensitiveHelp (that is th small yellow textboxes) is in a .txt file like in my last post.
    In another file (.h) is the information that maps the "IDH_CONTROL1" with the WhatsThisHelpID. Number of the Control. Make sure the numbers in this file match with your app.
    The file like this
    VB Code:
    1. #define IDH_CONTROL1    1

    in the .hhp file of your HTMLHelp Project it should look like this
    VB Code:
    1. [FILES]
    2. Help.htm
    3.  
    4. [ALIAS]
    5.  
    6. [MAP]
    7. #include ContextSensitiveHelp.h
    8.  
    9. [TEXT POPUPS]
    10. ContextSensitiveHelp.h
    11. ContextSensitiveHelp.txt

    I hope you can solve your problem now.
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

  11. #11
    Addicted Member
    Join Date
    Aug 2002
    Location
    Michigan
    Posts
    181
    Dear Opus,
    I am still in a state of frustration. I have blown the last hour trying experiments to get it to work.
    It refuses to map the popup topics to numbers!

    My understanding is that the .h file will not work because VB does not recognize the C## syntax. I had to create a MAP segment in the .hhp file to make the regular help file work for that reason. I need to go to the supermarket, but I am going to give the .h file another try first.

    Before I do, I am going to review your post again!

  12. #12

    Thread Starter
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863
    As of my findings, forget about the C## problem,
    just create the .txt and .h file using a editor.
    I'm not sure whow to make the [MAP] and the [TEXT POPUP] section, I just edited the .hhp file in an editor and entered the lines from my last post manuallly. After that open it using the workshop, compile it and ............ (Don't forget the codeline in your application App.Helfile= ...)
    Call me if you have any further problems, but remember for it'S the LateNightShow now, I might not be around till tomorrow.
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

  13. #13
    Addicted Member
    Join Date
    Aug 2002
    Location
    Michigan
    Posts
    181
    Dear Opus,
    I created a small project, with one cmd button on a single form. I created a tiopic in an htm file, an Alias section & a Map section. I was able to open the help file with F1.

    I created a text file with one topic and an h file with the context assignment. It never maps the number to the topic!!!

    I tried multiple insertions of the .h file. I tried puting the def in the Map section. No way!! It absolutely refuses to make the connection!
    The docs tell us to put the map information for the html topics in the .h file. That absolutely will not work, so I doubt that it will work any better for pop up topics. For blessed sure it ain't working for me!!! Is there some obscure detail you ommitted?? Could you post your sample app & help project files so we can see exactly what you did to make it function???

  14. #14

    Thread Starter
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863
    Some questions:
    -1-
    You say F1 opens the Help-file, if you the contextSensitiveHelp you need to set the following properieties of your Form
    VB Code:
    1. WhatsThisButton =   -1  'True
    2.   WhatsThisHelp   =   -1  'True
    Note.This setting is to be done for each form seperatly.

    That way F1 will give you the contextSensitiveHelp of the Control that has the Focus.

    -2-
    Did you set the .WhatsThisHelpID Properity of your cmdButton to the number that corresponds to the .topic in your .txt and .h file?

    All cmdButtons with a .WhatsThisHelpID =0 will show nothing, if the number is not mapped, a pop with be displaed with a text like " Not help for this command" (not sure about the correct text, since it comes in the language of your system).

    -3-
    Did you get any error messages when trying to compile the help-project using the HTML-Hlp-Workshop?

    I can't post my sources now (I'm at working, and doing this programming in my OffTime). I could post the Help Project files this evening ( I'm living at GMT+1).

    In the meantime, what does your app say when you try to get a ContextSensitiveHelp (Press of F1 with Focus on CommandButton or Click on "?" followed by a click on the commandButton.
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

  15. #15
    Addicted Member
    Join Date
    Aug 2002
    Location
    Michigan
    Posts
    181
    Dear Opus,
    The Help Workshop refuses to map the text file's topics to the numbers in the .h file. Only context ids in the alias & map sections get mapped... only for regular .htm files, not for text popups.

    I inserted the .h file in the map section as well as in the text pop up section. I set whats this help to true, & set the whats this help context Ids. When I try to use the whats this help, the program puts its head thru a noose and hangs!!

    The root problem seems to be that it refuses to map the numbers to the topics in the text file!!!

    As I understand it, VB6 is supposed to have the whole works enabled off the shelf. If the chm file is done right, everything should work. The one functional demo I downloaded uses a help class to do it. I want to avoid the fancy stuff.

  16. #16

    Thread Starter
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863
    The one functional demo I downloaded uses a help class to do it. I want to avoid the fancy stuff.
    You took the words right out of my mouth!

    I guess to problem is in the creation of the .chm file.
    Which HTMLWorkShop are you using?
    You could post your project-files, I'll try to compile them at home at we might get another clue what's wrong!

    BTW In here it's 08:20 am -6degrees Celcius and ****ing cold!

    (Ho put those **** in there, I said something else ;-) )
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

  17. #17
    Addicted Member
    Join Date
    Aug 2002
    Location
    Michigan
    Posts
    181
    Good Morning, Opus!
    It is now 2:33 a.m. The temp. is about 25°F. Weather Bug crashed me, so I shut it down. Just barely avoided losing the whole system, and I was shutting off the system to go to bed when your message came in!
    I have zipped the files and will attempt to attach them. There may be some confusion, because I am tired, and frustrated. I had files in the VB98 folder, and newer files in the Opus folder. Both are zipped up. I won't swear to the current state of the properties on the form. I do not always save it when testing, and the whats this help always hangs it!!
    Sorry about the file names. These were not intended for publication!!

    By the way, I am glad your English is good!! Two semesters of Deutsch were not enough, and Ich habe alles vergessen!!!
    Attached Files Attached Files

  18. #18

    Thread Starter
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863
    Good morning Ben ;-) , I hope you got enough sleep!

    I've got it!
    Your Opus.chm file works fine! Even though it has nearly nothing in it!

    The problem is in your application (opus.vbp more exact in Opus.frm)
    in the properties of the Opus Form, you need to set :
    VB Code:
    1. WhatsThisButton=-1 (TRUE)
    2. WhatsThisHelp=-1(TRUE)
    By setting the first, the second will be automatically setr, if you do it in the IDE. BBUt I do guess, you had those settings during your test (but not saved).
    Using those setting you will see the questionmark beside the "X" on the righthand top of the Form.


    But more important you have the following:
    VB Code:
    1. Private Sub Form_Load()
    2. App.HelpFile = "C:\Opus\Opus.chm"
    3. '"Opus.chm::/Opus.txt"
    4. End Sub
    This way only the complete helpfile would be displayed if you hit F1, since F1 is no longer connected to the help (acc. the settings from above) nothing will show.
    I assume you also used the commented part (Opus.chm::/Opus.txt) in this Sub. That way the application will crash (it did for me at least), the reason is easy. You seem to like my nick, but in this case you used it a bit to much. The file Opus.txt has been automaticaly written by the HTMLWorkshop while creating your .chm. Your correct filename for this was Text1.txt (I hope you remember).
    So the correct line should read:
    VB Code:
    1. Private Sub Form_Load()
    2. App.HelpFile = "C:\Opus.chm::/Text1.txt"
    3. End Sub

    It worked for!

    I hope your problem is solved now!
    If you have any more question on how to do the TabelofContents, the Index or whow to open the HelpWindow on a specific point, just yell.
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

  19. #19
    Addicted Member
    Join Date
    Aug 2002
    Location
    Michigan
    Posts
    181
    Well, I'll be God Blessed!! You are absolutely right, Opus!!! One bleeping misnomer frustrated the whole task!!
    Thank you!!!

    Now I have another interesting finding:
    Whats this help captures F1. Invoking the html help topic requires shutting off the whats this & removing the name of the text file.


    My previous use of help was rtf, by means of Help Maker Plus. Word & I do not get along well, and I had problems with the add in. I had to make all the jumps manually!! I used windows help instead of popups. For the current project I am tempted to use html help for the forms and whats this popups for the individual fields. Implementing a separate help button will not be a big deal.

    For other frustrated Help Workshop users, I will recommend HTML HELP CENTER <a href="http://www.mvps.org/htmlhelpcenter/whcomplete.htm"> Here</a>.

  20. #20
    Addicted Member
    Join Date
    Aug 2002
    Location
    Michigan
    Posts
    181
    Well, I'll be God Blessed!! You are absolutely right, Opus!!! One bleeping misnomer frustrated the whole task!!
    Thank you!!!

    Now I have another interesting finding:
    Whats this help captures F1. Invoking the html help topic requires shutting off the whats this & removing the name of the text file.


    My previous use of help was rtf, by means of Help Maker Plus. Word & I do not get along well, and I had problems with the add in. I had to make all the jumps manually!! I used windows help instead of popups. For the current project I am tempted to use html help for the forms and whats this popups for the individual fields. Implementing a separate help button will not be a big deal.

    For other frustrated Help Workshop users, I will recommend HTML HELP CENTER <a href="http://www.mvps.org/htmlhelpcenter/whcomplete.htm"> Here</a>.

    Someone linked to Helpgen. That little freeware addin is very powerful. It mines your project for forms & controls and does almost everything but compose the topics & maps.

  21. #21

    Thread Starter
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863
    Now I have another interesting finding:
    Whats this help captures F1. Invoking the html help topic requires shutting off the whats this & removing the name of the text file.
    ?? (language problem)??
    If I got it right, you're talking about that while using the WhatThisHelp you cannot access the complete help by "F1".
    That correct, but you don't need to change to App.HelpFile setting in order to show the file.
    By use of an API-Cal you can open it in different ways ( I used the folowing so far :TOC open, Index open or to display a specific topic inside the file)
    You want the code?
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

  22. #22

    Thread Starter
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863
    The tutorial is good, but they use the class method insted of the API method. I found an example on the API method. let know your EMAIL, i'll send it (170 KB which is to big for the forum).
    By looking at it, you will see whow to open the .chm file although WhatThis Help is used.
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

  23. #23

    Thread Starter
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863
    The tutorial is good, but they use the class method insted of the API method. I found an example on the API method. let know your EMAIL, i'll send it (170 KB which is to big for the forum).
    By looking at it, you will see whow to open the .chm file although WhatThis Help is used.
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

  24. #24
    Addicted Member
    Join Date
    Aug 2002
    Location
    Michigan
    Posts
    181
    Dear Opus,
    Here is the code I used to implent a help menu.

    CommonDialog1.HelpFile = "ezest.hlp"
    CommonDialog1.HelpContext = 204
    CommonDialog1.HelpCommand = cdlHelpContext
    CommonDialog1.ShowHelp ' Display

    My project ported an app from DOS to W95. In the process, there were significant changes & enhancements.
    #204 is a list of hyperlinks to frequently asked questions.

    I think that this method can be implemented with a command button. Three cheers for the KISS rule!

    What is your method??

  25. #25

    Thread Starter
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863
    I started off with .chm files and I'm using the API method to show the help.

    Maybe I'm stupid but what's the "KISS" rule (remember I'm from the last century!)?
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

  26. #26

    Thread Starter
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863
    BTW I'm on AOL Instant messenger "trudelopus"
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

  27. #27
    Addicted Member
    Join Date
    Aug 2002
    Location
    Michigan
    Posts
    181
    Dear Opus, to give you an accurate rendition, I would need some new memory chips and I would get myself expelled from the forum. ...
    "Keep it simple, stupid" I can't spell it right, but the last word would probably translate 'scheiskopf'. The meaning is this: avoid sphagetti code & document it well, 'cuz you might be the sucker who has to maintain it someday!!!

    My email is [email protected]
    Yes, that is the famous Torch Lake on the 45th paralell.

  28. #28
    Addicted Member
    Join Date
    Aug 2002
    Location
    Michigan
    Posts
    181
    Dear Opus,
    I was wrong again! I figured I could change the whats this help switch at run time. VB will not allow it! Shellexecute opens the file, but does not seem to afford a way to select the topic. I distilled the minimum requirement from the demo you sent. This will allow whats this help. I can call the help api from a command button with a map number to
    open the help file to the topic I want.

    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

    Const HH_HELP_CONTEXT = &HF ' Display mapped numeric value in ' dwData.

    'Use this call to invoke the help file; lngMapNumber is the number of the selected topic.
    HTMLHelp hWnd, "MyHelp.chm", HH_HELP_CONTEXT, lngMapNumber

  29. #29
    Fanatic Member
    Join Date
    Nov 2001
    Location
    Bangkok
    Posts
    969

    Great thread here

    Hi opus, Ben Powell (related to the other powell, hehe?) and Martin Liss.

    Opus:
    Can you please email me the tutorial to [email protected] ?
    I would be very happy if you do it.

    Martin Liss:
    Can you please send me the example project with the context sensitive help to the same email address?
    .... Maybe there should be in the VBForum a section for Resolved major problems where are all the threads with an download that are for sure solved and really major problems, like this here and others?


    I like this thread here very much because it goes to the roots of the help system.


    nice greetings
    Franky

  30. #30
    Addicted Member
    Join Date
    Aug 2002
    Location
    Michigan
    Posts
    181
    Hi, Franky,
    To the best of my knowledge, 'Cousin' Collin is not related to my tribe. They came from Yorkshire, through Canada to Michigan. Some of my shirttail cousins are spread out all over the country, so it is not possible to be sure!

    I am now satisfied that I have what I need to implement html help in my current project. There was plenty of frustration in the process. I see by previous threads that I am not the only one to suffer frustration in the process!

    The links previously posted should prove very helpful if you follow them carefully.

  31. #31

    Thread Starter
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863
    Franky,
    besides the findings dicussed in this thread, use the following link:
    www.mvps.org/htmlhelpcenter/index.html
    That should get you started.
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

  32. #32
    Hyperactive Member chuddy's Avatar
    Join Date
    Oct 2002
    Posts
    333
    Here is a link to the part for context sensitve stuff for VB...

    "Complete What's This For Visual Basic 6"

    http://www.mvps.org/htmlhelpcenter/whcomplete.htm

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width