IMoniker Interface


Provides the managed definition of the IMoniker interface, with COM functionality from IPersist and IPersistStream.

public interface class IMoniker
public interface IMoniker
public interface IMoniker
public interface IMoniker
type IMoniker = interface
type IMoniker = interface
type IMoniker = interface
Public Interface IMoniker


For more information about the IMoniker, IPersist, and IPersistStream interfaces, see the MSDN Library.

The common language runtime throws an exception when a COM method in native code returns an HRESULT. For more information, see How to: Map HRESULTs and Exceptions.


BindToObject(IBindCtx, IMoniker, Guid, Object)

Uses the moniker to bind to the object that it identifies.

BindToStorage(IBindCtx, IMoniker, Guid, Object)

Retrieves an interface pointer to the storage that contains the object identified by the moniker.

CommonPrefixWith(IMoniker, IMoniker)

Creates a new moniker based on the common prefix that this moniker shares with another moniker.

ComposeWith(IMoniker, Boolean, IMoniker)

Combines the current moniker with another moniker, creating a new composite moniker.

Enum(Boolean, IEnumMoniker)

Supplies a pointer to an enumerator that can enumerate the components of a composite moniker.


Retrieves the class identifier (CLSID) of an object.

GetDisplayName(IBindCtx, IMoniker, String)

Gets the display name, which is a user-readable representation of the current moniker.


Returns the size, in bytes, of the stream needed to save the object.

GetTimeOfLastChange(IBindCtx, IMoniker, FILETIME)

Provides a number representing the time that the object identified by the current moniker was last changed.


Calculates a 32-bit integer using the internal state of the moniker.


Provides a moniker that, when composed to the right of the current moniker or one of similar structure, composes to nothing.


Checks the object for changes since it was last saved.


Compares the current moniker with a specified moniker and indicates whether they are identical.

IsRunning(IBindCtx, IMoniker, IMoniker)

Determines whether the object that is identified by the current moniker is currently loaded and running.


Indicates whether this moniker is of one of the system-supplied moniker classes.


Initializes an object from the stream where it was previously saved.

ParseDisplayName(IBindCtx, IMoniker, String, Int32, IMoniker)

Reads as many characters of the specified display name as the ParseDisplayName(IBindCtx, IMoniker, String, Int32, IMoniker) understands and builds a moniker corresponding to the portion read.

Reduce(IBindCtx, Int32, IMoniker, IMoniker)

Returns a reduced moniker, which is another moniker that refers to the same object as the current moniker but can be bound with equal or greater efficiency.

RelativePathTo(IMoniker, IMoniker)

Supplies a moniker that, when appended to the current moniker (or one with a similar structure), yields the specified moniker.

Save(IStream, Boolean)

Saves an object to the specified stream.

Applies to