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

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

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

由于存根方法具有私有或受保护的可访问性,或由于安全问题,包含托管互操作方法的接口无权访问存根方法。

适用于