Results 1 to 4 of 4
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Newbury, Berkshire, England
    Posts
    712
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Read a Help File (A2K sr1)

    I need to read the ocx help file for an ActiveX control whilst building a form.

    So I used the command button wizard to create the following code:

    Private Sub cmdOcxHelp_Click()
    On Error GoTo Err_cmdOcxHelp_Click

    Dim stAppName As String

    stAppName = "D:Program FilesDirectOCXInfo OCXhelpOCXHELP.HLP"
    Call Shell(stAppName, 1)

    Exit_cmdOcxHelp_Click:
    Exit Sub

    Err_cmdOcxHelp_Click:
    MsgBox Err.Description
    Resume Exit_cmdOcxHelp_Click

    End Sub

    I get the error

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Read a Help File (A2K sr1)

    Rupert,
    You have to invoke the winhlp32.exe program witch is in the windowssystem directory.

    stAppName = "C:Windowswinhlp32.exe D:Program FilesDirectOCXInfo OCXhelpOCXHELP.HLP"

    in the case that your windir c:windows is
    Francois

  3. #3
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Newbury, Berkshire, England
    Posts
    712
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Read a Help File (A2K sr1)

    Thanks for that Francois

    That

  4. #4
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Altnau, Thurgau, Switzerland
    Posts
    447
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Read a Help File (A2K sr1)

    What happens if the user has the 'Windows' directory as Win98? The code breaks. Using hard coded paths is bad coding. Find the paths to the desired directories by calls to the op system.



    Declare Function GetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
    Declare Function GetSystemDirectory Lib "kernel32" Alias "GetSystemDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long

Posting Permissions

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