HelpViewerEmbeddedClient API

The HelpViewerEmbeddedClient API is used to make calls to the DotNet Help system, including context-sensitive help (CSH) calls. This API supports embedded CSH calls and can also provide Dynamic Help functionality. When you use this API, the MadCap Help Viewer opens in the same process as your application.

If instead you require detached Help, opening the Help Viewer in a separate process from your application, see HelpViewerClient API.

How to use the HelpViewerEmbeddedClient 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. Use the functionality of the Help System object. For more information, see IEmbeddedHelpSystem API.

Name Description
public void HelpViewerEmbeddedClient() Creates an instance of the HelpViewerEmbeddedClient.
public void HelpViewerEmbeddedClient( string title ) Creates an instance of the HelpViewerEmbeddedClient. Sets the title of the Help system to the string specified in title.
public void HelpViewerEmbeddedClient( string title, Icon icon ) Creates an instance of the HelpViewerEmbeddedClient. Sets the title of the Help system to the string specified in title. Sets the icon of the help system to the icon specified in icon.
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 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.
public IEmbeddedHelpSystem HelpSystem Gets an interface to the Help system. See IEmbeddedHelpSystem API for more information.
public virtual string Title Gets the title of the Help system.

examples

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

// Create a group box where the embedded help topic will be displayed

GroupBox mTopicPanel = new GroupBox();
mTopicPanel.Location = new System.Drawing.Point( 32, 204 );
mTopicPanel.Name = "mTopicPanel";
mTopicPanel.Text = "Help Topic";

// Display a topic embedded in the group box

HelpViewerEmbeddedClient client = new HelpViewerEmbeddedClient();

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

 client.HelpSystem.DynamicHelpPanel = mTopicPanel;
 client.HelpSystem.LoadTopic( "MyID1" );
}