ManagedToNativeComInteropStubAttribute(Type, String) 建構函式

定義

使用指定的類別型別和方法名稱,初始化 ManagedToNativeComInteropStubAttribute 類別的新執行個體。

public:
 ManagedToNativeComInteropStubAttribute(Type ^ classType, System::String ^ methodName);
public ManagedToNativeComInteropStubAttribute (Type classType, string methodName);
new System.Runtime.InteropServices.ManagedToNativeComInteropStubAttribute : Type * string -> System.Runtime.InteropServices.ManagedToNativeComInteropStubAttribute
Public Sub New (classType As Type, methodName As String)

參數

classType
Type

包含所需 Stub 方法的類別。

methodName
String

Stub 方法的名稱。

例外狀況

找不到 methodName

-或-

方法不是靜態或非泛用的。

-或-

方法的參數清單不符合 Stub 的預期參數清單。

因為 Stub 方法具有私用或保護的存取範圍,或因為安全性問題,包含受 Managed Interop 方法的介面無法存取 Stub 方法。

適用於