ModuleBuilder.DefinePInvokeMethodCore 方法

定義

在衍生類別中覆寫時,定義 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 ^> ^ parameterTypes, 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[]? parameterTypes, System.Runtime.InteropServices.CallingConvention nativeCallConv, System.Runtime.InteropServices.CharSet nativeCharSet);
abstract member DefinePInvokeMethodCore : string * string * string * System.Reflection.MethodAttributes * System.Reflection.CallingConventions * 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, parameterTypes 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

方法的傳回類型。

parameterTypes
Type[]

方法參數的類型。

nativeCallConv
CallingConvention

原生呼叫慣例。

nativeCharSet
CharSet

方法的原生字元集。

傳回

已定義的 PInvoke 方法。

適用於