UtilWin32GetNativeFunctionTDelegate Method
Gets a function exported in a native dll.
Namespace: DevCase.Win32Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
public static TDelegate GetNativeFunction<TDelegate>(
string filepath,
string functionName
)
Public Shared Function GetNativeFunction(Of TDelegate) (
filepath As String,
functionName As String
) As TDelegate
Dim filepath As String
Dim functionName As String
Dim returnValue As TDelegate
returnValue = UtilWin32.GetNativeFunction(filepath,
functionName)
public:
generic<typename TDelegate>
static TDelegate GetNativeFunction(
String^ filepath,
String^ functionName
)
static member GetNativeFunction :
filepath : string *
functionName : string -> 'TDelegate
No code example is currently available or this language may not be supported.
- filepath String
-
The file path of the native dll.
- functionName String
-
The name of the function to be retrieved.
- TDelegate
-
The Type of the source Delegate
that will represent the signature of the native function.
TDelegate
The resulting
Delegate which represents a pointer to the method invoker.
This is a code example.
No code example is currently available or this language may not be supported.
Public Module Module1
''' ----------------------------------------------------------------------------------------------------
''' <summary>
''' A delegate to call DllRegisterServer or DllUnregisterServer functions in a native dll.
''' </summary>
''' ----------------------------------------------------------------------------------------------------
''' <returns>
''' The result of calling DllRegisterServer or DllUnregisterServer functions in a native dll.
''' </returns>
''' ----------------------------------------------------------------------------------------------------
<UnmanagedFunctionPointer(CallingConvention.StdCall)>
Friend Delegate Function PointerToRegistrationMethodInvoker() As Integer
Public Sub Main()
Dim methodInvoker As PointerToRegistrationMethodInvoker =
GetNativeFunction(Of PointerToRegistrationMethodInvoker)("C:\native.dll", "DllRegisterServer")
Dim result As Integer = methodInvoker.Invoke()
If (result <> 0) Then
' To-Do: Handle specific errors...
End If
End Sub
End Module
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.