IMoniker::ParseDisplayName

HRESULT IMoniker::ParseDisplayName(pbc, pmkToLeft, lpszDisplayName, pcchEaten, ppmkOut)

Given that the composite moniker (pmkToLeft + [composition operation] (the receiver)) is the moniker which has so far been parsed, parse as much of the remaining tail as is appropriate. In general, the maximal prefix of lpszDisplayName which is syntactically valid and which currently represents an existing object should be consumed.

The main loop of MkParseDisplayName finds the next piece moniker piece by calling this function on the moniker-so-far that it holds on to, passing NULL through pmkToLeft. In the case that the moniker-so-far is a generic composite, this is forwarded by that composite onto its last piece, passing the prefix of the composite to the left of the piece in pmkToLeft.

lpszDisplayName is the as-yet-to-be-parsed tail of the display name. This function is to consume as much of it as is appropriate for a name within the object identified by (pmkToLeft + [composition operation] (the receiver)) and return the corresponding moniker.

Some moniker classes will be able to handle this parsing internally to themselves since they are designed to designate only certain kinds of objects. Others will need to bind to the object that they designate in order to accomplish the parsing process. As is usual, these objects should not be released by IMoniker::ParseDisplayName but instead should be transferred to the bind context for release at a later time.

If a syntax error occurs, then NULL should be returned through ppmkOut and MK_E_SYNTAX returned. In addition, the number of characters of the display name that were successfully parsed should be returned through pcchEaten.

Argument

Type

Description

pbc

IBindCtx*

The binding context in which to accumulate bound objects.

pmkToLeft

IMoniker*

The moniker to the left of this one in the so-far-parsed display name.

lpszDisplayName

LPSTR

The display name to be parsed.

pcchEaten

ULONG*

The number of characters of the input name that this parse consumed.

ppmkOut

IMoniker*

The resulting moniker.

return value

HRESULT

S_OK, MK_E_SYNTAX.