The IHlink interface enables a COM object known as a hyperlink to completely encapsulate the behavior of navigating to its target location.
Hyperlinks are managed by COM hyperlink container objects, which support the IHlinkSite interface for hyperlinks within the container and the IHlinkTarget interface for hyperlinks referring to documents or document objects within it.
IHlink provides methods for a hyperlink object to navigate to its target, access a friendly name for display purposes, and identify itself to its container and frame.
Typically, you do not need to implement this interface. A standard implementation of a hyperlink component is provided as part of the system, and it is not advisable to implement another version. A document can use the standard hyperlink object to represent hyperlinks within itself, thus encapsulating the capability of navigating, saving, loading, dragging, dropping, cutting, and pasting hyperlinks. The standard hyperlink object implements IHlink, IPersistStream, and IDataObject interfaces.
The support for IPersistStream means that hyperlink objects may be saved to or loaded from a stream, and the support for IDataObject means that hyperlink objects may be cut and pasted.
IHlink interfaces are typically called by an application's hyperlink container as part of a user interface for creating new hyperlinks. Standard hyperlink objects are created via the HlinkCreateFromData, HlinkCreateFromMoniker, HlinkCreateFromString, and OleLoadFromStream functions.
While the hyperlink object provides many useful functions that are needed for general purpose uses, often applications are only interested in navigating to a hyperlink target. For simple navigation needs, there are a number of "helper" functions such as HlinkSimpleNavigateToString, HlinkSimpleNavigateToMoniker, and HlinkNavigateToStringReference that allow simple hyperlink navigation without any knowledge of other hyperlink interfaces or objects.
Hyperlink navigation involves transitioning from one document/object/application, known as the hyperlink container, to another document/object/application, known as the hyperlink target. Usually, both remain running, but the hyperlink target visually replaces the hyperlink container (from which the navigation originated). There are three "flavors" of hyperlink containers and targets.
The following are possible forms of navigation:
IUnknown Methods | Description |
---|---|
QueryInterface | Returns pointers to supported interfaces. |
AddRef | Increments reference count. |
Release | Decrements reference count. |
IHlink Methods | Description |
---|---|
SetHlinkSite | Saves the interface pointer on the site object. |
GetHlinkSite | Retrieves the interface pointer on the site object. |
SetMonikerReference | Sets the moniker reference of the target. |
GetMonikerReference | Retrieves the moniker and location portions of the target. |
SetStringReference | Sets the name and location portions of the target. |
GetStringReference | Retrieves the name and location portions of the target. |
SetFriendlyName | Sets the friendly name of the target. |
GetFriendlyName | Retrieves the friendly name of the target. |
SetTargetFrameName | Sets the name of the target frame. |
GetTargetFrameName | Retrieves the name of the target frame. |
GetMiscStatus | Queries if hyperlink is absolute or relative. |
Navigate | Navigates to the given target. |
SetAdditionalParams | Sets additional hyperlink parameters. |
GetAdditionalParams | Retrieves additional hyperlink parameters. |
Windows NT: Use version 5.0 or later.
Windows: Unsupported.
Windows CE: Unsupported.
Header: Declared in hlink.h.
HlinkNavigateToStringReference, HlinkSimpleNavigateToMoniker, HlinkSimpleNavigateToString