TypeBuilder.DefinePInvokeMethodCore Method

Definition

When overridden in a derived class, defines a PInvoke method with the provided name, DLL name, entry point name, attributes, calling convention, return type, types of the parameters, PInvoke flags, and custom modifiers for the parameters and return type.

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

Parameters

name
String

The name of the PInvoke method. name cannot contain embedded nulls.

dllName
String

The name of the DLL in which the PInvoke method is defined.

entryName
String

The name of the entry point in the DLL.

attributes
MethodAttributes

A bitwise combination of the enumeration values that specifies the attributes of the method.

callingConvention
CallingConventions

The method's calling convention.

returnType
Type

The method's return type.

returnTypeRequiredCustomModifiers
Type[]

An array of types representing the required custom modifiers

returnTypeOptionalCustomModifiers
Type[]

An array of types representing the optional custom modifiers

parameterTypes
Type[]

The types of the method's parameters.

parameterTypeRequiredCustomModifiers
Type[][]

An array of arrays of types. Each array of types represents the required custom modifiers for the corresponding parameter.

parameterTypeOptionalCustomModifiers
Type[][]

An array of arrays of types. Each array of types represents the optional custom modifiers for the corresponding parameter.

nativeCallConv
CallingConvention

The native calling convention.

nativeCharSet
CharSet

The method's native character set.

Returns

A MethodBuilder representing the defined PInvoke method.

Applies to