IMoniker::Inverse
Provides a
moniker that, when composed to the right of this moniker or one of similar
structure, will destroy it (the moniker will compose to nothing).
HRESULT Inverse(
IMoniker **ppmk |
//Indirect pointer to the inverse of the moniker |
); |
|
Parameter
ppmk
[out] When
successful, indirect pointer to the IMoniker interface on a moniker that
is the inverse of this moniker. In this case, the implementation must call IUnknown::AddRef
Return Values
The method
supports the standard return value E_OUTOFMEMORY, as well as the following:
S_OK
The inverse
moniker has been returned successfully.
MK_E_NOINVERSE
The moniker
class does not have an inverse.
Remarks
The inverse
of a moniker is analogous to the .. directory in MS-DOS file systems; the
.. directory acts as the inverse to any other directory name, because
appending .. to a directory name results in an empty path. In the same way,
the inverse of a moniker typically is also the inverse of all monikers in the
same class. However, it is not necessarily the inverse of a moniker of a
different class.
The inverse
of a composite moniker is a composite consisting of the inverses of the
components of the original moniker, arranged in reverse order. For example, if
the inverse of A is Inv( A ) and the composite of A, B, and C is Comp( A, B, C
), then
Inv( Comp( A,
B, C ) )
is equal to
Comp( Inv( C
), Inv( B ), Inv( A ) ).
Not all
monikers have inverses. Most monikers that are themselves inverses, such as
anti-monikers, do not have inverses. Monikers that have no inverse cannot have
relative monikers formed from inside the objects they identify to other objects
outside.
Notes to Callers
An object
that is using a moniker to locate another object usually does not know the
class of the moniker it is using. To get the inverse of a moniker, you should
always call IMoniker::Inverse rather than the CreateAntiMoniker
The IMoniker::Inverse
method is also called by the implementation of the IMoniker::RelativePathTo
Notes to Implementers
If your
monikers have no internal structure, you can call the CreateAntiMoniker
See Also