IMoniker::Inverse

HRESULT IMoniker::Inverse(ppmk)

Answer a moniker that when composed onto the end of this moniker or one of similar structure will annihilate it; that is, will compose to nothing. IMoniker::Inverse will be needed in implementations of IMoniker::RelativePathTo, which are important for supporting monikers that track information as it moves about.

This is the abstract generalization of the ".." operation in traditional file systems. For example a File Moniker which represented the path "a\b\c\d" would have as its inverse a moniker containing the path "..\..\..\..", since "a\b\c\d" composed with "..\..\..\.." yields nothing.

Notice that an the inverse of a moniker does not annihilate just that particular moniker, but all monikers with a similar structure, where structure is of course interpreted with respect to the particular moniker. Thus, the inverse of a Generic Composite Moniker is the reverse composite of the inverse of its pieces. Monikers which are non-generic composites (such as File Monikers are presently implemented) will also have non-trivial inverses, as we just saw. However, there will be many kinds of monikers whose inverse is trivial: the moniker adds one more piece to an existing structure; its inverse is merely a moniker that removes the last piece of the existing structure. A moniker that when composed onto the end of a generic moniker removes the last piece is provided; see CreateAntiMoniker. Monikers with no internal structure can return one of these as their inverse.

Not all monikers have inverses. The inverse of an anti-moniker, for example, does not exist. Neither will the inverses of most monikers which are themselves inverses. It is conceivable that other monikers do not have inverses as well; a macro moniker might be an example. Monikers which have no inverse cannot have relative paths formed from things inside the objects they denote to things outside.

Argument

Type

Description

ppmk

IMoniker**

The place to return the inverse moniker.

return value

HRESULT

S_OK, MK_E_NOINVERSE.