Voici une petite dll ecrite en C qui permet de déréférencer et référencer (je crois c'est le terme)
Pour ceux qui utilise les api windows, ca permet d'eviter les lourdeurs de la fonction copymemory.
Déclaration
utilisation (je sais c'est pas le bon exemple)
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 Private Declare Function getByte Lib "<chemin_dll>\pointer.dll" (ByVal p As Long) As Byte Private Declare Sub setByte Lib "<chemin_dll>\pointer.dll" (ByVal newval As byte, ByVal p As Long) Private Declare Function getInteger Lib "<chemin_dll>\pointer.dll" (ByVal p As Long) As Integer Private Declare Sub setInteger Lib "<chemin_dll>\pointer.dll" (ByVal newval As Long, ByVal p As Long) Private Declare Function getLong Lib "<chemin_dll>\pointer.dll" (ByVal p As Long) As Long Private Declare Sub setLong Lib "<chemin_dll>\pointer.dll" (ByVal newval As Long, ByVal p As Long) Private Declare Function getSingle Lib "<chemin_dll>\pointer.dll" (ByVal p As Long) As single Private Declare Sub setSingle Lib "<chemin_dll>\pointer.dll" (ByVal newval As Single, ByVal p As Long) Private Declare Function getDouble Lib "<chemin_dll>\pointer.dll" (ByVal p As Long) As Double Private Declare Sub setDouble Lib "<chemin_dll>\pointer.dll" (ByVal newval As Double, ByVal p As Long)
lien utile : http://rp.developpez.com/vb/tutoriels/dll/
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9 Dim b As Long, p as Long b = 20 p=VarPtr(b) MsgBox getLong(p) setLong 10, p MsgBox b
Partager