IMoniker 介面

定義

提供 IMoniker 介面的 Managed 定義,具有 IPersistIPersistStream 的 COM 功能。Provides the managed definition of the IMoniker interface, with COM functionality from IPersist and IPersistStream.

public interface class IMoniker
[System.Runtime.InteropServices.Guid("0000000f-0000-0000-C000-000000000046")]
[System.Runtime.InteropServices.InterfaceType(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)]
public interface IMoniker
type IMoniker = interface
Public Interface IMoniker
屬性

備註

如需有關 IMonikerIPersistIPersistStream 介面的詳細資訊,請參閱 MSDN Library。For more information about the IMoniker, IPersist, and IPersistStream interfaces, see the MSDN Library.

當原生程式碼中的 COM 方法傳回 HRESULT 時,common language runtime 會擲回例外狀況。The common language runtime throws an exception when a COM method in native code returns an HRESULT. 如需詳細資訊,請參閱 How to: Map HRESULTs and ExceptionsFor more information, see How to: Map HRESULTs and Exceptions.

方法

BindToObject(IBindCtx, IMoniker, Guid, Object)

使用 Moniker 繫結至其所識別的物件。Uses the moniker to bind to the object that it identifies.

BindToStorage(IBindCtx, IMoniker, Guid, Object)

擷取含有 Moniker 所辨識物件的儲存體的介面指標。Retrieves an interface pointer to the storage that contains the object identified by the moniker.

CommonPrefixWith(IMoniker, IMoniker)

根據這個 Moniker 與另一個 Moniker 共用的共同首碼建立新 Moniker。Creates a new moniker based on the common prefix that this moniker shares with another moniker.

ComposeWith(IMoniker, Boolean, IMoniker)

將目前 Moniker 與另一個 Moniker 組合,以建立新的複合型 Moniker。Combines the current moniker with another moniker, creating a new composite moniker.

Enum(Boolean, IEnumMoniker)

提供列舉值 (可列舉複合型 Moniker 的元件) 的指標。Supplies a pointer to an enumerator that can enumerate the components of a composite moniker.

GetClassID(Guid)

擷取物件的類別識別項 (Class Identifier,CLSID)。Retrieves the class identifier (CLSID) of an object.

GetDisplayName(IBindCtx, IMoniker, String)

取得顯示名稱,其為目前 Moniker 的使用者可讀取的表示。Gets the display name, which is a user-readable representation of the current moniker.

GetSizeMax(Int64)

傳回儲存物件所需的資料流大小 (以位元組為單位)。Returns the size, in bytes, of the stream needed to save the object.

GetTimeOfLastChange(IBindCtx, IMoniker, FILETIME)

提供數字,表示這個 Moniker 所識別的物件上次變更的時間。Provides a number representing the time that the object identified by the current moniker was last changed.

Hash(Int32)

使用 Moniker 的內部狀態來計算 32 位元整數。Calculates a 32-bit integer using the internal state of the moniker.

Inverse(IMoniker)

在目前 Moniker 右邊或其中一個相似結構組成時,提供未組成的 Moniker。Provides a moniker that, when composed to the right of the current moniker or one of similar structure, composes to nothing.

IsDirty()

檢查物件自從上次儲存以來是否變更。Checks the object for changes since it was last saved.

IsEqual(IMoniker)

比較目前的 Moniker 與指定的 Moniker,指出它們是否相同。Compares the current moniker with a specified moniker and indicates whether they are identical.

IsRunning(IBindCtx, IMoniker, IMoniker)

決定目前 Moniker 所識別的物件,目前是否已載入並在執行中。Determines whether the object that is identified by the current moniker is currently loaded and running.

IsSystemMoniker(Int32)

指示這個 Moniker 是否為系統提供的 Moniker 類別的其中之一。Indicates whether this moniker is of one of the system-supplied moniker classes.

Load(IStream)

從先前儲存物件的資料流來初始化它。Initializes an object from the stream where it was previously saved.

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

ParseDisplayName(IBindCtx, IMoniker, String, Int32, IMoniker) 所能瞭解的數量來讀取指定顯示名稱的字元,並建置對應於讀取部分的 Moniker。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)

傳回縮減的 Moniker,其為與目前 Moniker 參考相同物件的另一個 Moniker,但可以用相同或較高的效率來繫結。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)

附加到目前 Moniker (或類似結構) 時,提供可產生指定 Moniker 的 Moniker。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.

適用於