次の方法で共有


MonikerRelativePathTo (Compact 2013)

3/26/2014

This function provides a moniker that, when composed onto the end of the first specified moniker (or one with a similar structure), yields the second specified moniker. This function is intended for use only by IMoniker::RelativePathTo implementations.

Syntax

WINOLEAPI MonikerRelativePathTo(
  LPMONIKER pmkSrc,
  LPMONIKER pmkDest, 
  LPMONIKER FAR* ppmkRelPath, 
  BOOL dwReserved
);

Parameters

  • pmkSrc
    [in] Pointer to the IMoniker interface on the moniker that, when composed with the relative moniker to be created, produces pmkDest. This moniker identifies the "source" of the relative moniker to be created.
  • pmkDest
    [in] Pointer to the IMoniker interface on the moniker to be expressed relative to pmkSrc. This moniker identifies the destination of the relative moniker to be created.
  • ppmkRelPath
    [out] Address of IMoniker* pointer variable that receives the interface pointer to the new relative moniker. When successful, the function has called IUnknown::AddRef on the moniker and the caller is responsible for calling IUnknown::Release. If an error occurs, the interface pointer value is NULL.
  • dwReserved
    [in] Reserved; must be non-zero.

Return Value

This function supports the standard return value E_INVALIDARG, E_OUTOFMEMORY, and E_UNEXPECTED, as well as the following:

  • S_OK
    A meaningful relative path has been returned.
  • MK_S_HIM
    The only form of the relative path is the other moniker.
  • MK_E_NOTBINDABLE
    Indicates that pmkSrc is a relative moniker, such as an item moniker, and must be composed with the moniker of its container before a relative path can be determined.

Remarks

Call MonikerRelativePathTo only in the implementation of IMoniker::RelativePathTo if you are implementing a new moniker class.

Your implementation of IMoniker::RelativePathTo should first check whether the other moniker is of a type you recognize and handle in a special way. If not, you should call MonikerRelativePathTo, passing itself as pmkThis and the other moniker as pmkOther. MonikerRelativePathTo correctly handles the cases where either moniker is a generic composite.

You should call this function only if pmkSrc and pmkDest are both absolute monikers, where an absolute moniker is either a file moniker or a generic composite whose leftmost component is a file moniker, and where the file moniker represents an absolute path. Do not call this function on relative monikers.

To determine whether the platform supports this function, see Determining Supported COM APIs.

Requirements

Header

objbase.h

Library

ole32.lib

See Also

Reference

COM Functions
IMoniker::RelativePathTo