CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2001
    Location
    Canada
    Posts
    4

    Displaying a help file

    Can anyone tell me the proper way of displaying a help file using the common dialogue box showhelp method? I've tried it; but the help file does not display. I even set the HelpFile property. So far, I have only been able to display the help file by connecting it to the application through the project properties dialogue box, and then pressing F1.


  2. #2
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: Displaying a help file

    I use to send "F1" from code using sendkeys when needed (ie: pressing a help button on my form). I do not use the commondialogbox. I associate the help file to my project (project,properties->help file name).


    Special thanks to Lothar "the Great" Haensler. Come back soon, you Guru.
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  3. #3
    Join Date
    Sep 1999
    Location
    France
    Posts
    393

    Re: Displaying a help file

    Personnaly i use the WinHelp API:



    'Declaration of WinHelp command constants
    public Const HELP_CONTEXT = &H1 ' Display topic in ulTopic
    public Const HELP_QUIT = &H2 ' Terminate help
    public Const HELP_INDEX = &H3 ' Display index
    public Const HELP_CONTENTS = &H3
    public Const HELP_HELPONHELP = &H4 ' Display help on using help
    public Const HELP_SETINDEX = &H5 ' set current Index for multi index help
    public Const HELP_SETCONTENTS = &H5
    public Const HELP_CONTEXTPOPUP = &H8
    public Const HELP_FORCEFILE = &H9
    public Const HELP_KEY = &H101 ' Display topic for keyword in offabData
    public Const HELP_COMMAND = &H102
    public Const HELP_PARTIALKEY = &H105
    public Const HELP_MULTIKEY = &H201
    public Const HELP_SETWINPOS = &H203

    public Declare Function WinHelp Lib "user32" Alias "WinHelpA" (byval hwnd as Long, _
    byval lpHelpFile as string, _
    byval wCommand as Long, _
    byval dwData as Long) as Long
    WinHelp hwnd, HELPFILEPATH, HELP_CONTEXT, ID




    I know you're looking for commondialog, but if you change your mind...


  4. #4
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: Displaying a help file

    I like your solution. At firts occurence, I will try.
    Best regards,
    Cesare Imperiali

    Special thanks to Lothar "the Great" Haensler. Come back soon, you Guru.
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  5. #5
    Join Date
    Apr 2001
    Location
    Canada
    Posts
    4

    Re: Displaying a help file

    Thank you for your help. I had never heard of that; but I tried it and it worked...


  6. #6
    Join Date
    Apr 2000
    Location
    South Carolina,USA
    Posts
    2,210

    Re: Displaying a help file

    The CommonDialog.ShowHelp is really outdated. It was conceived before the current Html stuff was implemented and involves creation of .hlp and .cnt files using the Help Workshop editor and other miscellaneous programs that have fallen by the wayside since Windows 95 was obsoleted.
    Better of using Html editors and the WinHelp stuff. It's much more flexible. Also uses more resources so you can support buying bigger and better hardware.
    At any rate, if you have .hlp and .cnt files, here is how you would implement

    private Sub Form_Load()
    Dim stHelp
    stHelp = App.Path & "\Envelope Help\Envelope help.hlp"
    cdlCommon.HelpFile = stHelp
    cdlCommon.HelpCommand = cdlHelpContents
    cdlCommon.ShowHelp

    End Sub




    John G

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

Featured