RAD Studio |  |

Implementing IExtendedHelpViewer
See Also
Collapse All

ICustomHelpViewer only provides direct support for keyword-based Help. Some Help systems (especially WinHelp) work by associating numbers (known as context IDs) with keywords in a fashion which is internal to the Help system and therefore not visible to the application. Such systems require that the application support context-based Help in which the application invokes the Help system with that context, rather than with a string, and the Help system translates the number itself.

Applications can talk to systems requiring context-based Help by extending the object that implements ICustomHelpViewer to also implement IExtendedHelpViewer. IExtendedHelpViewer also provides support for talking to Help systems that allow you to jump directly to high-level topics instead of using keyword searches. The built-in WinHelp viewer does this for you automatically.

IExtendedHelpViewer exposes four functions. Two of them—UnderstandsContext and DisplayHelpByContext—are used to support context-based Help; the other two—UnderstandsTopic and DisplayTopic—are used to support topics.

When an application user presses F1, the Help Manager calls

Copy Code

    IExtendedHelpViewer.UnderstandsContext(const ContextID: Integer;
    const HelpFileName: String): Boolean

Copy Code

    int__fastcall IExtendedHelpViewer::UnderstandsContext(const int ContextID, AnsiString HelpFileName)

and the currently activated control supports context-based, rather than keyword-based Help. As with ICustomHelpViewer.UnderstandsKeyword, the Help Manager queries all registered Help viewers iteratively. Unlike the case with ICustomHelpViewer.UnderstandsKeyword, however, if more than one viewer supports a specified context, the first registered viewer with support for a given context is invoked.

The Help Manager calls

Copy Code

    IExtendedHelpViewer.DisplayHelpByContext(const ContextID: Integer;
    const HelpFileName: String)

Copy Code

    void__fastcall IExtendedHelpViewer::DisplayHelpByContext(const int ContextID, AnsiString
    HelpFileName)

after it has polled the registered Help viewers.

The topic support functions work the same way:

Copy Code

    IExtendedHelpViewer.UnderstandsTopic(const Topic: String): Boolean

Copy Code

    bool__fastcall IExtendedHelpViewer::UnderstandsTopic(const AnsiString Topic)

is used to poll the Help viewers asking if they support a topic;

Copy Code

    IExtendedHelpViewer.DisplayTopic(const Topic: String)

Copy Code

    void__fastcall IExtendedHelpViewer::DisplayTopic(const AnsiString Topic)

is used to invoke the first registered viewer which reports that it is able to provide help for that topic.

See Also

Enabling Help in Applications

Help System Interfaces

Communicating with the Help Manager

Implementing ICustomHelpViewer

Asking the Help Manager for Information

Displaying Tables of Contents

Implementing IExtendedHelpViewer

Implementing IHelpSelector

Registering Help System Objects

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!