IOleUILinkContainer::SetLinkSource

Changes the source of a link.

HRESULT SetLinkSource(

DWORD dwLink,
//Unique 32-bit link identifier
LPTSTR lpszDisplayName,
//Source string to parse
ULONG FAR* lenFileName,
//The length of the filename portion
ULONG FAR* pchEaten,
//Number of characters successfully parsed
BOOL fValidateSource
//Specifies whether or not moniker should be validated
);

Parameters

dwLink

A container-defined unique 32-bit identifier for a single link. See IOleUILinkContainer::GetNextLink .

lpszDisplayName

Points to new source string to be parsed.

lenFileName

The length of the leading filename portion of the lpszDisplayName string. If the link source is not stored in a file, then lenFileName should be 0. For OLE links, call IOleLink::GetSourceDisplayName.

pchEaten

[out] Points to the number of characters successfully parsed in lpszDisplayName.

fValidateSource

TRUE if the moniker should be validated; for OLE links, MkParseDisplayName should be called. FALSE if the moniker should not be validated. If possible, the link should accept the unvalidated source, and mark itself as unavailable.

Return Values

S_OK

Successfully changed the links source.

E_FAIL

Unable to change the links source.

E_INVALIDARG

One or more invalid arguments.

E_OUTOFMEMORY

Insufficient memory.

E_ACCESSDENIED

Insufficient access permissions.

Comments

Notes To Callers

Call this method from the Change Source dialog, with fValidateSource initially set to TRUE. Change Source can be called directly or from the Links dialog. If this call to SetLinkSource returns an error (e.g., MkParseDisplayName failed because the source was unavailable), then you should display an Invalid Link Source message, and the user should be allowed to decide whether or not to fix the source. If the user chooses to fix the source, then the user should be returned to the Change Source dialog with the invalid portion of the input string highlighted. If the user chooses not to fix the source, then SetLinkSource should be called a second time with fValidateSource set to FALSE, and the user should be returned to the Links dialog with the link marked Unavailable.

See Also

MkParseDisplayName

Software for developers
Delphi Components
.Net Components
Software for Android Developers
More information resources
MegaDetailed.Net
Unix Manual Pages
Delphi Examples
Databases for Amazon shops developers
Amazon Categories Database
Browse Nodes Database