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

包含所需存根方法的类。

methodName
String

存根方法的名称。

例外

methodName 找不到。

-或-

该方法不是静态方法或非泛型方法。

-或-

方法的参数列表与存根的预期参数列表不匹配。

包含托管互操作方法的接口无法访问存根方法,因为存根方法具有私有或受保护的辅助功能,或者由于安全问题。

适用于