HlinkCreateFromData

Creates a standard hyperlink object from a COM object that supports the IDataObject interface. Typically, this object originates from a data transfer operation, such as copying to and pasting from the clipboard, or via a drag-and-drop operation.

HRESULT HlinkCreateFromData(

IDataObject* piDataObj,

//Interface on target data from which to create the hyperlink

IHlinkSite* pihlsite,

//Interface on hyperlink site

DWORD dwSiteData,

//Additional site data

IUnknown *piunkOuter,

//Interface which controls aggregation

REFIID riid,

//Interface identifier on new hyperlink object

Void ** ppvObj

//Receives the requested interface’s pointer

);

Parameters

piDataObj
[in] Pointer to the IDataObject interface on the data object of interest. Used to access the methods to retrieve the data from the object.
pihlsite
[in] Pointer to the IHlinkSite interface for the new hyperlink within its container.
dwSiteData
[in] Additional site data associated with the hyperlink site.
piunkOuter
[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.
ppvObj
[out] On return, indirect 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 functions that you can use to create a hyperlink. HlinkCreateFromData creates a hyperlink from a COM object which supports both the IDataObject interface and 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 a COM object for which you know the moniker, use HlinkCreateFromMoniker. To create a hyperlink from a COM 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