Share via


How to: Add the Help Pane Proxy Object to a Visual Basic Project

To integrate the Microsoft Help 2.0 components with your project, you add a Help Pane reference to your Visual Basic project, and then create an instance of the Help Pane proxy object.

To add a reference for the Help Pane proxy object

  1. On the Visual Studio Project menu, click Add Reference.

  2. Click the Browse tab.

  3. In the File name text box, enter the path to C:\Windows\System32\HelpPaneProxy.dll.

  4. Click OK.

To create an instance of the Help Pane proxy object

  1. Add an Imports statement for the Help Pane at the beginning of the code for your main form. (The Imports statement declares the HelpPane namespace and lets you call the HelpPane methods directly.)

    Imports HelpPane
    
  2. Create a new module using the module template.

  3. Declare the session as a public variable in the module.

  4. Add an Imports HelpPane statement at the beginning of the code for the class module.To take advantage of the Microsoft IntelliSense features in Microsoft Visual Basic and to achieve faster performance, use early binding to create your Help Pane session.

    Imports HelpPane
    Module Module1
       Public objHelpPane As HxHelpPane
    '...
    End Module
    
  5. Create a new instance of the Help Pane proxy object.

    objHelpPane = New HxHelpPane
    

    The Help Pane proxy object can now be called from any form in the project, and will remain as long as it is required. You do not have to explicitly un-initialize a session. Because the Help Pane proxy object is COM-based, the garbage collector handles marshaling through the interop assembly that was created when the component was added to the project.

Example

The following example demonstrates creating an instance of the Help Pane proxy object, then calling the DisplayContents method on the Help Pane.

Imports HelpPane
Module Module1
Public objHelpPane As HxHelpPane
   Sub Main()
      Try
         objHelpPane = New HelpPane.HxHelpPane
         objHelpPane.DisplayContents("")
      Catch ex1 As Exception
         Console.WriteLine(ex1)
      End Try
   End Sub
End Module

See Also

Other Resources

Help Pane API Overview