Creates a new system hyperlink object from a moniker, a location string, and a friendly name string (used for displaying the hyperlink).
HlinkCreateFromMoniker(
IMoniker *
pmkTarget, //Interface on hyperlink target moniker
LPCWSTR szLocation, //Named location of hyperlink reference within target
LPCWSTR szFriendlyName, //Display name of hyperlink
IHlinkSite * phlSite, //Interface on hyperlink site
DWORD dwSiteData, //Additional site data
IUnknown * punkOuter, //Whether or not object is part of an aggregate
REFIID riid, //Interface ID on new hyperlink object
Void * ppv //Receives the requested interfaceÆs pointer
);
Parameters
pmkTarget
[in] A pointer to the moniker to the hyperlink target for the new hyperlink. May not be NULL.
szLocation
[in] A named location within the hyperlink target which resolves to the hyperlink reference.
szFriendlyName
[in] A string to use as the display name for the hyperlink.
phlSite
[in] Pointer to the IHlinkSite object for the new hyperlink within the hyperlink container.
dwSiteData
[in] Additional site data for the new hyperlink object.
punkOuter
[in] Pointer to the controlling IUnknown interface for the new hyperlink object. If NULL, the new hyperlink object is not aggregated.
riid
[in] Identifies the interface to return on the new hyperlink. Typically IID_IHlink, or IID_IUnknown when punkOuter is non-NULL.
ppv
[out] On return, pointer to the pointer to the requested interface.
Return Values
S_OK
A new hyperlink object was created successfully.
Remarks
HlinkCreateFromData is one of three helper APIÆs that you can use to create a hyperlink. HlinkCreateFromData creates a hyperlink from an OLE object which both supports the IDataObject interface and supports a hyperlink format CF_HYPERLINK on that IDataObject interface. HlinkQueryCreateFromData is typically called before the call to HlinkCreateFromData to determine if both these conditions are met. To create a hyperlink from an OLE object for which you know the moniker, use HlinkCreateFromMoniker. To create a hyperlink from an OLE object for which you have the name but not the moniker, use HlinkCreateFromString.
HlinkCreateFromMoniker creates new hyperlinks from an existing target moniker, a location string within the target, and a friendly name string used to identify how to display the hyperlink. This methodÆs typical use is as part of a user interface for creating new hyperlinks from existing hyperlinks, or for editing existing hyperlinks, using a dialog or form to prompt for the strings. This function is significantly faster than HlinkCreateFromString.
See Also
HlinkCreateFromData, HlinkCreateFromString, HlinkQueryCreateFromData