ModuleBuilder.DefinePInvokeMethodCore Methode

Definition

Wenn eine abgeleitete Klasse überschrieben wird, wird eine PInvoke Methode definiert.

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);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("P/Invoke marshalling may dynamically access members that could be trimmed.")]
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);
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("P/Invoke marshalling may dynamically access members that could be trimmed.")>]
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

Parameter

name
String

Der Name der PInvoke Methode. name Eingebettete Nullwerte können nicht enthalten.

dllName
String

Der Name der DLL, in der die PInvoke Methode definiert ist.

entryName
String

Der Name des Einstiegspunkts in der DLL.

attributes
MethodAttributes

Eine bitweise Kombination der Enumerationswerte, die die Attribute der Methode angibt.

callingConvention
CallingConventions

Die Aufrufkonvention der Methode.

returnType
Type

Der Rückgabetyp der Methode.

parameterTypes
Type[]

Die Typen der Parameter der Methode.

nativeCallConv
CallingConvention

Die systemeigene Anrufkonvention.

nativeCharSet
CharSet

Der systemeigene Zeichensatz der Methode.

Gibt zurück

Die definierte PInvoke Methode.

Attribute

Gilt für: