dcsimg
Results 1 to 13 of 13

Thread: adding compiled html help to a vb6 app

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2018
    Posts
    4

    adding compiled html help to a vb6 app

    Hello I am having trouble attempting to add html help to my application the app is a vb6 program. I have just updated the program but the winhelp will not work in windows 10.
    Please note I am a novice in vb6 my program was originally program with a partner who left the business many years ago so I update the program as necessary

    I found a blog on VB form which gave me the code to place in my program but it can not find my compiled html help file fw4hlp.chm.

    My program uses a hard wired directory as it must reference many tables.

    ShowHtmlHelp App.Path & "My Help Files.chm", "Main.htm"

    I changed it to this

    ShowHtmlHelp App.Path & "fw4hlp.chm", "Main.htm"

    in the main program I have a bunch of tables that are used by the program

    perhaps the problem is the app path?
    f
    rom my app
    'gs_Path = App.Path this commented out in the program and green in color
    gs_Path = "C:\elecsoft08" 'updated for 08 to 08' this used to hardwire the program to find the tables

    any ideas? Thank you

  2. #2
    Lively Member
    Join Date
    Mar 2018
    Posts
    121

    Re: adding compiled html help to a vb6 app

    Your path to the chm is wrong. App.Path does not have a trailing backslash. So your path ends us being

    C:\elecsoft08fw4hlp.chm

    instead of

    C:\elecsoft08\fw4hlp.chm

    use this code
    Code:
    ShowHtmlHelp App.Path & "\fw4hlp.chm", "Main.htm"

    note: chm files had a number of security vulnerabilities so you may find that some antivir prevents them from loading or they will quarantine hhctrl.ocx causing other issues.

  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 2018
    Posts
    4

    Re: adding compiled html help to a vb6 app

    Thank you I followed your directions but it still won't work. I think you note sums it up windows 10 has me locked out. I think I will add a statement on the welcome screen directing the user to access a user manual in pdf format and word format

  4. #4

    Thread Starter
    New Member
    Join Date
    Jul 2018
    Posts
    4

    Re: adding compiled html help to a vb6 app

    thanks for your help it did not work .I think you note is correct and Windows 10 is preventing me from using the help file.
    So I'm going to post a note on the welcome screen to send the user to folder containing the user manuals in both pdf and word format

  5. #5
    PowerPoster
    Join Date
    Feb 2006
    Posts
    19,149

    Re: adding compiled html help to a vb6 app

    I tried running an old Project here that is just a demo of CHM Help usage. Seems to run fine on Windows 10 without even recompiling.

    What have I missed?
    Attached Files Attached Files

  6. #6
    Lively Member
    Join Date
    Mar 2018
    Posts
    121

    Re: adding compiled html help to a vb6 app

    Quote Originally Posted by dilettante View Post
    What have I missed?
    20 years of MS attempting to secure chm files

    2002 - https://www.cvedetails.com/cve/CVE-2002-0694/

    2006 -https://blogs.msdn.microsoft.com/neerajag/2006/04/26/ever-wondered-why-your-chm-files-does-not-work/

    2018 - https://social.technet.microsoft.com...tprocurrentver

    With many, many fixes in between.

    Then then security vendors start messing with them:
    https://tools.cisco.com/security/cen...?alertId=12221

    And then IT gets in on the action with group policies, reg hacks, etc.

    This is the perfect example:
    A microsoft employee cannot read a chm create by microsoft on a microsoft computer.
    https://blogs.msdn.microsoft.com/crm...e-ig-chm-file/

    Note that this was an "easy" fix for him but restricted users may not have the option to unblock. And tell your users to do this is tedious and annoying.

    So they work on your computer. And on mine. But depending on what your customers are using for security, you may find them blocked at various times or permanently. Avoid if possible.

  7. #7
    PowerPoster
    Join Date
    Feb 2006
    Posts
    19,149

    Re: adding compiled html help to a vb6 app

    That's a ridiculous argument. Of course some downloaded file types get blocked, but that has nothing to do with any "antivirus."

    If a PC is locked down users should not attempt to bypass that.

  8. #8
    Lively Member
    Join Date
    Mar 2018
    Posts
    121

    Re: adding compiled html help to a vb6 app

    Quote Originally Posted by dilettante View Post
    That's a ridiculous argument. Of course some downloaded file types get blocked, but that has nothing to do with any "antivirus."
    You asked what you were missing.

    If a Microsoft employee can't view a chm created by Microsoft on a computer managed by Microsoft IT, it doesn't bode well for the rest of us.

    I'm not telling thousands of people to unblock a file or fighting with corporate IT departments to modify their security products. It is a complete waste of time.

    Also, chuck doesn't seem like a technical person and I doubt he wants to spend time figuring out what antivirus, registry setting, group policy, hotfix, security update has broken his help file for the next 20 years
    Last edited by DllHell; Jul 13th, 2018 at 12:12 PM.

  9. #9

    Thread Starter
    New Member
    Join Date
    Jul 2018
    Posts
    4

    Re: adding compiled html help to a vb6 app

    Thanks to both you I appreciate your knowledge and expertise. That's why I joined the form. You are correct that I am not a technical person when it comes to VB. My expertise is with the National Electric Code NFPA 70 and this program assists Engineers, Electrical contractors, designers . . . with the use of the NEC Code to calculate Electrical service loads for Occupancies for permit requirements. The NEC rules change every three years and I have to update the program as needed. My program is intended to help teach the proper calculation methods required. I'm retired now so thought one last upgrade might keep me helping people in the electrical field; also keep me active. This program has been out there since Win 3.1 and every time I have had trouble it has been with Microsoft's every changing operating system. Once again thank you both for your insights and expertise.

  10. #10
    Frenzied Member
    Join Date
    Feb 2017
    Posts
    1,187

    Re: adding compiled html help to a vb6 app

    Hello. I prefer to use other ways of providing help.

    1) .pdf files.
    2) Word .doc or .rtf files (rtf can be read without Word)
    3) in some cases just text files.
    4) Inside the program itself, usually using RichTextBox controls.
    5) A website and links to pages could be also valid. But I don't like very much that myself.
    vbExtra: Print preview for VB6, print FlexGrids and more.
    MSDN online for VB6, Language reference.

  11. #11
    PowerPoster
    Join Date
    Feb 2006
    Posts
    19,149

    Re: adding compiled html help to a vb6 app

    The example I posted above focuses on the less obvious stuff like providing context help, "what's this" help, etc.

    Perhaps you are just after the simple "show topic" help? Here is another demo using the same CHM file:

    Code:
    Option Explicit
    '
    'Use two different ways to pass the topic.
    '
    
    Private Sub Command1_Click()
        HtmlHelp.HtmlHelp hWnd, _
                          StrPtr(App.Path & "\Demo.chm"), _
                          HH_DISPLAY_TOPIC, _
                          StrPtr("010210 Name.htm")
    End Sub
    
    Private Sub Command2_Click()
        HtmlHelp.HtmlHelp hWnd, _
                          StrPtr(App.Path & "\Demo.chm::/010220 Address.htm"), _
                          HH_DISPLAY_TOPIC, _
                          WIN32_NULL
    End Sub
    
    Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
        'Unload any and all HtmlHelp windows.  Needed for IDE runs to avoid potential
        'crashes.
        '
        'Do this before the main Form's Unload event:
        HtmlHelp.HtmlHelp 0, 0, HH_CLOSE_ALL, 0
    End Sub
    Attached Files Attached Files

  12. #12
    PowerPoster
    Join Date
    Feb 2006
    Posts
    19,149

    Re: adding compiled html help to a vb6 app

    Note that the string of digits as in "010210 Name.htm" above was just part of a naming convention I had used to name HTML pages used in that CHM document.

  13. #13
    Addicted Member
    Join Date
    Sep 2014
    Posts
    190

    Re: adding compiled html help to a vb6 app

    Eletric Chuck,

    You mentioned "winhelp" and the call syntax you used appears not for a HTML Help CHM file.

    Neverthelsss, for your reference, I have been using the following to invoke a CHM (for well over 10 years):

    (1) If it is not for a specific page link, I call
    Code:
    HtmlHelp Me.hwnd, [File spec of CHM], HH_HELP_TOPIC, 0&
    (2) When there is a specific page link, then
    Code:
    mHelpHandle = HtmlHelp(Me.hwnd, [File spec of CHM], HH_HELP_CONTEXT, ByVal 1016&)
    If mHelpHandle = 0 Then             ' Link failed
        HtmlHelp Me.hwnd, [File spec of CHM], HH_HELP_TOPIC, 0&
    End If
    The above "1016" is a link. You can check the relevant folder to see if there is a file with the file extension ".h" in existence. If yes, open it with say WordPad and you shall see some numbers resembling "1016" (likely of different digits though); you may try out any of them.

    Brenker

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width