Creates a standard hyperlink object from an OLE object that supports the IDataObject interface. Typically, this object originates from a data transfer operation, such as copy-paste using the clipboard, or via drag-and-drop.
HRESULT HlinkCreateFromData(
IDataObject*
pdatobj, //Interface on target data from which to create the hyperlink
IHlinkSite* phlSite, //Interface on hyperlink site
DWORD dwSiteData, //Additional site data
IUnknown *punkOuter, //Interface which controls aggregation
REFIID riid, //Interface ID on new hyperlink object
Void ** ppv //Receives the requested interfaceÆs pointer
);
Parameters
pdatobj
[in] Pointer to the IDataObject interface pointer on the data object of interest. Used to access the methods to retrieve the data from the object.
phlSite
[in] Pointer to the IHlinkSite interface pointer for the new hyperlink within its container.
dwSiteData
[in] Additional site data associated with the hyperlink site.
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
The new hyperlink object was created successfully.
E_NOINTERFACE
The object did not support the riid interface.
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.
HlinkCreateFromData is typically used by a hyperlink container as part of a user interface that creates new hyperlinks via the clipboard or a drag-and-drop operation.
See Also
HlinkCreateFromMoniker, HlinkCreateFromString, HlinkQueryCreateFromData