Creates a new hyperlink object from strings representing the hyperlink target, the location within the target, and a friendly name.
HlinkCreateFromString(
LPCWSTR
szTarget, //String helping to identify the hyperlink target
LPCWSTR szLocation, //Location within the hyperlink target of new hyperlink object
LPCWSTR szFriendlyName, //Friendly name of the hyperlink
IHlinkSite * phlSite, //Site for the new hyperlink object
DWORD dwSiteData, //Additional site data for the new hyperlink object
IUnknown * punkOuter, //Whether or not object is part of an aggregate
REFIID riid, //Interface ID on new browse context object
Void * ppv //Location of the requested interfaceÆs pointer
);
Parameters
szTarget
[in] String to help identify the hyperlink target. This string is resolved into a moniker via MkParseDisplayNameEx.
szLocation
[in] The string representing the location within the hyperlink target for the new hyperlink. May not be NULL.
szFriendlyName
[in] The string to use as the friendly name for the hyperlink. This is typically a display name referenced by the user interface.
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] Points to the controlling IUnknown for the new browse context. If NULL, the new browse context 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.
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.
HlinkCreateFromString is typically used by hyperlink containers as part of the user-interface for creating brand new hyperlinks, where the user fills in a form or dialog of items -- target, location, friendly name -- which are used to construct the hyperlink.
See Also
HlinkCreateFromData, HlinkCreateFromMoniker, HlinkQueryCreateFromData