TypeBuilder.DefinePInvokeMethodCore 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
在衍生類別中覆寫時,使用提供的名稱、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
方法。
適用於
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應