Dim monResultat As Long monResultat = exemple
exemple = 4012
monResultat = FxpCommand(ByVal StrToPtr(maChaine), ...
Private Declare Sub CopyMemory_Long Lib "kernel32" Alias "RtlMoveMemory" (hpvDest As Long, _ ByVal hpvSource As Long, _ ByVal cbCopy As Long)
Private Function StrToPtr(ByRef Chaine As String) As Long ' Remplace la fonction StrPtr (interdite pour Net) ' Voir explications http://www.romanpress.com/Articles/Strings_R/Strings.htm Dim Resultat As Long CopyMemory_Long Resultat, ByVal VarPtr(Chaine), 4 StrToPtr = Resultat End Function
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionPublic Declare Function Exemple Lib "maDLL.dll" () As Long
Public Declare Function Exemple Lib "c:\mon répertoire\maDLL.dll" () As Long
Public Declare Function Exemple Lib "maDLL.dll" (ByRef Param1 As Long, ByRef Param2 As Long) As LongIl faut, bien entendu, respecter scrupuleusement le format que tu as utilisé dans la fonction source.
Option Explicit Public pRequest As String Public pDataptr As String Public Declare Function FxpCommand Lib "C:\Program Files\Cscape\FxServe.dll" Alias "?FxpCommand@@YGHPBDPAPAEPAHPAUHWND__@@@Z" (ByVal pRequest As String, ByVal pDataptr As String, ByVal pDataSise As Long, ByVal h As Long) As Long
Private Sub Command1_Click() Dim retour As Long pRequest = "open" pDataptr = "Name:Default1|USB-to-Serial Port Driver (COM3)|Timeout:1000" Call FxpCommand(pRequest, pDataptr, 0, 0) retour = FxpCommand Label1.Caption = retour End Sub
Dim pHandle As Long pHandle = VarPtr(maVariableLong)