HlinkCreateFromMonikerHlinkCreateFromMoniker*
*Contents  *Index  *Topic Contents
*Previous Topic: HlinkCreateFromData
*Next Topic: HlinkCreateFromString

HlinkCreateFromMoniker

HRESULT HlinkCreateFromMoniker(
    IMoniker * pimkTrgt,    //Interface on hyperlink target moniker
    LPCWSTR pwzLocation,    //Named location of hyperlink reference within target
    LPCWSTR pwzFriendlyName,     //Display name of hyperlink
    IHlinkSite * pihlsite,       //Interface on hyperlink site
    DWORD dwSiteData,       //Additional site data
    IUnknown * piunkOuter,       //Whether or not object is part of an aggregate
    REFIID riid,        //Interface identifier on new hyperlink object
    Void * ppvObj       //Receives the requested interface's pointer
   );

Creates a new system hyperlink object from a moniker, a location string, and a friendly name string (used for displaying the hyperlink).

pimkTrgt
[in] Address of the moniker to the hyperlink target for the new hyperlink. Must not be NULL.
pwzLocation
[in] Address of a named location within the hyperlink target that resolves to the hyperlink reference.
pwzFriendlyName
[in] Address of a string to use as the display name for the hyperlink.
pihlsite
[in] Address of the IHlinkSite object for the new hyperlink within the hyperlink container.
dwSiteData
[in] Additional site data for the new hyperlink object.
piunkOuter
[in] Address of the controlling IUnknown interface for the new hyperlink object. If NULL, the new hyperlink object is not aggregated.
riid
[in] Used to identify 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.

HlinkCreateFromMoniker is one of three helper functions that you can use to create a hyperlink. HlinkCreateFromData creates a hyperlink from a COM object that 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.

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 box or form to prompt for the strings. This function is significantly faster than HlinkCreateFromString.

See also HlinkCreateFromData, HlinkCreateFromString, HlinkQueryCreateFromData


Up Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.