UtilWin32CallNativeFunctionTResult, TDelegate Method

Executes a function exported in a native dll and returns the result value.

Definition

Namespace: DevCase.Win32
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
public static TResult CallNativeFunction<TResult, TDelegate>(
	string filepath,
	string functionName,
	TDelegate functionSignature,
	params Object[] parameters
)

Parameters

filepath  String
The file path of the native dll.
functionName  String
The name of the function to be executed.
functionSignature  TDelegate
A Delegate that will represent the signature of the native function.
parameters  Object
An argument list for the invoked function. This is an array of objects with the same number, order, and type as the parameters of the function to be invoked.

If there are no parameters, parameters should be null.If the method Any object in this array that is not explicitly initialized with a value will contain the default value for that object type.

For reference-type elements, this value is . For value-type elements, this value is 0, 0.0, or false, depending on the specific element type.

Type Parameters

TResult
The Type of the value returned by the native function.
TDelegate
The Type of the source Delegate that will represent the signature of the native function.

Return Value

TResult
The result of calling the native function.

Example

This is a code example.
C#
No code example is currently available or this language may not be supported.

See Also