HelpViewerClient API

The HelpViewerClient API is used to make DotNet Help calls, including those used for context-sensitive help (CSH) calls. HelpViewerClient only supports basic, non-embedded calls. It also does not provide Dynamic Help functionality. The HelpViewerClient API will open the Help Viewer in a separate process from your application.

If instead you require integrated Help, Dynamic Help, or opening the Help Viewer in the same process as your application, see HelpViewerEmbeddedClient API.

How to use the HelpViewerClient API

  1. Create an instance of the class using the constructor.
  2. Call Load() or TryLoad() to load the Help system of your choice.
  3. Call Search() or ShowTopic(). The first time either of these two methods are called, a new Help Viewer window will be launched. Every call after that will open the desired topic or search results in the existing Help Viewer window.

Name Description
public void HelpViewerClient() Creates an instance of the HelpViewerClient.
public void Load( string helpsystem ) Loads the Help system at the path specified in the helpsystem parameter. This method must be called once before calling Search() or ShowTopic(). If the Help system does not exist, an ArgumentException is thrown. See also TryLoad().
public void Search( string searchString ) Performs a search for the string specified in the searchString parameter.
public void Search( string searchString, string cshid ) Performs a search for the string specified in the searchString parameter. The cshid parameter is used to override the default starting topic of the Help system.
public void ShowTopic( string cshid ) Opens the Help system with the topic specified in cshid.
public bool TryLoad( string helpsystem ) See Load(). This method is equivalent to the Load() method. However, instead of throwing an exception, it returns true if the Help system was loaded successfully; it returns false otherwise.

examples

Refer to the sample application called "HelpViewerClientTester" for a fully functional application that uses the HelpViewerClient API. This sample application is available in the SDK, which you can download from http://www.madcapsoftware.com/downloads/flare020-ke5g.asp.

HelpViewerClient client = new HelpViewerClient();

if ( client.TryLoad( @"C:\My Project\Manual.mchelp" ) )

 client.ShowTopic( "MyID1" );
}