How to: Add the Help Pane Proxy Object to a C# Project

To integrate the Microsoft Help 2.0 components with your project, you add a reference to the Help Pane to your C# 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 a using directive for the Help Pane proxy object at the beginning of the code for the application.

    using HelpPane;
    
  2. Create a new instance of the Help Pane proxy object.

    HelpPane.HxHelpPane pane = new HelpPane.HxHelpPaneClass();
    

    The Help Pane proxy object can now be called, 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, and then calling the DisplayContents method on the Help Pane.

using System;
using HelpPane;

namespace SimpleHelpTest_CS
{
   class Program
   {
      static void Main(string[] args)
      {
         try
         {
            HelpPane.HxHelpPane pane = new HelpPane.HxHelpPaneClass();
            pane.DisplayContents("");
         }
         catch (Exception ex1)
         {
            Console.Write(ex1);
         }
      }
   }
}

See Also

Other Resources

Help Pane API Overview