Hi guys! Help please. How can i call the function(from a DLL) and pass parameters for that function if I only have the handle to that function? Please see my code below. Thanks in advance!
Code:Private Declare Function FreeLibrary Lib "kernel32" (ByVal hLibModule As Long) As Long Private Declare Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Long Private Declare Function GetProcAddress Lib "kernel32" (ByVal hModule As Long, ByVal lpProcName As String) As Long Dim loadngResult As Long, lngProcAddress As Long, maxnumpath As Long Dim sRet As String Const ERROR_SUCCESS = &H0 maxnumpath = 255 sRet = String$(MAX_PATH, 0) loadngResult = LoadLibrary("kernel32") If loadngResult <> 0 Then MsgBox "Load Succeessful!" lngProcAddress = GetProcAddress(loadngResult, "GetSystemDirectoryA") If lngProcAddress Then MsgBox "Function found!" 'CALL FUNCTION HERE -- HOW? Else MsgBox "Function not found!" End If Else MsgBox "Load Unsuccessful" End If FreeLibrary loadngResult




Reply With Quote