Marshal.BindToMoniker(String) Method

Definition

Gets an interface pointer identified by the specified moniker.

C#
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public static object BindToMoniker(string monikerName);
C#
public static object BindToMoniker(string monikerName);
C#
[System.Security.SecurityCritical]
public static object BindToMoniker(string monikerName);

Parameters

monikerName
String

The moniker corresponding to the desired interface pointer.

Returns

An object containing a reference to the interface pointer identified by the monikerName parameter. A moniker is a name, and in this case, the moniker is defined by an interface.

Attributes

Exceptions

An unrecognized HRESULT was returned by the unmanaged BindToMoniker method.

Remarks

BindToMoniker exposes the COM BindToMoniker method, which produces an object that you can cast to any COM interface you require. This method provides the same functionality as the GetObject method in Visual Basic 6.0 and Visual Basic 2005.

Applies to

Product Versions
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1