TypeBuilder.DefinePInvokeMethodCore 方法

定義

在衍生類別中覆寫時,使用提供的名稱、DLL 名稱、進入點名稱、屬性、呼叫慣例、傳回型別、參數類型、PInvoke 旗標的類型,以及參數和傳回型別的自訂修飾詞來定義 PInvoke 方法。

protected:
 abstract System::Reflection::Emit::MethodBuilder ^ DefinePInvokeMethodCore(System::String ^ name, System::String ^ dllName, System::String ^ entryName, System::Reflection::MethodAttributes attributes, System::Reflection::CallingConventions callingConvention, Type ^ returnType, cli::array <Type ^> ^ returnTypeRequiredCustomModifiers, cli::array <Type ^> ^ returnTypeOptionalCustomModifiers, cli::array <Type ^> ^ parameterTypes, cli::array <cli::array <Type ^> ^> ^ parameterTypeRequiredCustomModifiers, cli::array <cli::array <Type ^> ^> ^ parameterTypeOptionalCustomModifiers, System::Runtime::InteropServices::CallingConvention nativeCallConv, System::Runtime::InteropServices::CharSet nativeCharSet);
protected abstract System.Reflection.Emit.MethodBuilder DefinePInvokeMethodCore (string name, string dllName, string entryName, System.Reflection.MethodAttributes attributes, System.Reflection.CallingConventions callingConvention, Type? returnType, Type[]? returnTypeRequiredCustomModifiers, Type[]? returnTypeOptionalCustomModifiers, Type[]? parameterTypes, Type[][]? parameterTypeRequiredCustomModifiers, Type[][]? parameterTypeOptionalCustomModifiers, System.Runtime.InteropServices.CallingConvention nativeCallConv, System.Runtime.InteropServices.CharSet nativeCharSet);
abstract member DefinePInvokeMethodCore : string * string * string * System.Reflection.MethodAttributes * System.Reflection.CallingConventions * Type * Type[] * Type[] * Type[] * Type[][] * Type[][] * System.Runtime.InteropServices.CallingConvention * System.Runtime.InteropServices.CharSet -> System.Reflection.Emit.MethodBuilder
Protected MustOverride Function DefinePInvokeMethodCore (name As String, dllName As String, entryName As String, attributes As MethodAttributes, callingConvention As CallingConventions, returnType As Type, returnTypeRequiredCustomModifiers As Type(), returnTypeOptionalCustomModifiers As Type(), parameterTypes As Type(), parameterTypeRequiredCustomModifiers As Type()(), parameterTypeOptionalCustomModifiers As Type()(), nativeCallConv As CallingConvention, nativeCharSet As CharSet) As MethodBuilder

參數

name
String

PInvoke 方法的名稱。 name 不能包含內嵌的 null。

dllName
String

PInvoke 方法定義所在的 DLL 名稱。

entryName
String

DLL 中的進入點名稱。

attributes
MethodAttributes

列舉值的位元組合,指定 方法的屬性。

callingConvention
CallingConventions

方法的呼叫慣例。

returnType
Type

方法的傳回類型。

returnTypeRequiredCustomModifiers
Type[]

型別陣列,表示必要的自訂修飾詞

returnTypeOptionalCustomModifiers
Type[]

型別陣列,表示選擇性自訂修飾詞

parameterTypes
Type[]

方法參數的類型。

parameterTypeRequiredCustomModifiers
Type[][]

類型陣列的陣列。 每個類型的陣列都代表對應參數的必要自訂修飾詞。

parameterTypeOptionalCustomModifiers
Type[][]

類型陣列的陣列。 每一個型別陣列都表示對應參數的選擇性自訂修飾詞。

nativeCallConv
CallingConvention

原生呼叫慣例。

nativeCharSet
CharSet

方法的原生字元集。

傳回

MethodBuilder,代表定義的 PInvoke 方法。

適用於