Important: |
---|
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. |
This method returns the display name.
HRESULT GetDisplayName( IBindCtx * pbc , IMoniker * pmkToLeft , LPOlESTR * ppszDisplayName );
Parameters
Return Values
The method supports the standard return value E_OUTOFMEMORY, as well as the values described in the following table.
Value | Description |
---|---|
S_OK | The display name was successfully supplied. |
MK_E_EXCEEDEDDEADLINE | The binding operation could not be completed within the time limit specified by the bind context's BIND_OPTSstructure. |
E_NOTIMPL | There is no display name. |
Remarks
IMoniker::GetDisplayNameprovides a string that is a displayable representation of the moniker. A display name is not a complete representation of a moniker's internal state; it is simply a form that can be read by users. As a result, it is possible (though rare) for two different monikers to have the same display name. While there is no guarantee that the display name of a moniker can be parsed back into that moniker when calling the MkParseDisplayNamefunction with it, failure to do so is rare.
As examples, the file moniker implementation of this method supplies the path the moniker represents, and an item moniker's display name is the string identifying the item that is contained in the moniker.
Notes to Callers
It is possible that retrieving a moniker's display name may be an expensive operation. For efficiency, you may want to cache the results of the first successful call to IMoniker::GetDisplayName, rather than making repeated calls.
Notes to Implementers
If you are writing a moniker class in which the display name does not change, simply cache the display name and supply the cached name when requested. If the display name can change over time, getting the current display name might mean that the moniker has to access the object's storage or bind to the object, either of which can be expensive operations. If this is the case, your implementation of IMoniker::GetDisplayNameshould return MK_E_EXCEEDEDDEADLINE if the name cannot be retrieved by the time specified in the bind context's BIND_OPTSstructure.
A moniker that is intended to be part of a generic composite moniker should include any preceding delimiter (such as '\') as part of its display name. For example, the display name returned by an item moniker includes the delimiter specified when it was created with the CreateItemMonikerfunction. The display name for a file moniker does not include a delimiter because file monikers are always expected to be the leftmost component of a composite.
Requirements
Runs On | Versions | Defined in | Include | Link to |
---|---|---|---|---|
Windows CE OS | 2.0 and later | Oaidl.h |
Note This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.
See Also
CoGetMalloc, CreateItemMoniker, MkParseDisplayName, BIND_OPTS