1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
Declare Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Long
Public Declare Function FreeLibrary Lib "kernel32" (ByVal hLibModule As Long) As Long
Private Declare Function GetProcAddress Lib "kernel32" (ByVal hModule As Long, ByVal lpProcName As String) As Long
Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" _
(ByVal lpPrevWndFunc As Long, ByVal hWnd As Long, ByVal Msg As Long, _
ByVal wParam As Long, ByVal lParam As Long) As Long
Public Sub LancerFonction01()
Dim lngDll As Long
Dim lngFonction As Long
lngDll = LoadLibrary(App.Path & "\Test.dll")
if lngDll <> 0 then
lngFonction = GetProcAddress(lngDll, "Fonction01")
'''Mais là, c'est la panne : comment je passe les paramètres, ici de type String, à ma fonction ???????
End If
FreeLibrary lngDll
End Sub |