Using real pointers in VB!
This code uses undocumented functions of VB that gives you a pointer to a string or a number!
AI
AI Summary: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.
Source Code
Private Declare Sub CopyMemByPtr Lib "kernel32" Alias _ "RtlMoveMemory" (ByVal lpTo As Long, ByVal lpFrom As Long, _ ByVal lLen As Long) Private Sub Form_Click() Dim a As Long, b As String, c As Long, d As String Dim i As Integer, j As Long, k As Integer, l As Long Dim u(2) As Byte, o As Long b = "HELLO!" d = Space(Len(b)) i = 20 u(0) = 23 u(1) = 243 u(2) = 124 o = VarPtr(u(0)) j = VarPtr(i) l = VarPtr(k) a = StrPtr(b) c = StrPtr(d) CopyMemByPtr o + 1, j, Len(u(0)) * 2 CopyMemByPtr l, j, Len(i) * 2 CopyMemByPtr c, a, Len(b) * 2 MsgBox d & vbCr & k & vbCr & u(1) End Sub
Original Comments (3)
Recovered from Wayback Machine