'<CSCM>
'---------------------------------------------------------------------
'-- Name: Peek
'-- By: <SGD> on 04/19/2006
'-- Desc: Allows you to examine the contents of memory at any address
'-- for any number of bytes and returns this as a string of bytes.
'---------------------------------------------------------------------
'-- Note: To return STRING data, use PeekStr instead.
'---------------------------------------------------------------------
'-- Revd: <SGD> on 04/19/2006
'---------------------------------------------------------------------
'-- Parm: lngAddr (Long) = The VARPTR of the variable to read, or memory address
'-- lngBytes (Long) = The number of bytes to read.
'-- Typically, this value is defined as:
'-- Byte = 1
'-- Boolean = 2 (Booleans are implemented as Integers)
'-- Integer = 2
'-- Long = 4
'-- Single = 4
'-- Currency= 8 '-- Use CVC (return string) * 10,000 to get real value
'-- Double = 8 '-- Use CVC (return string) * 10,000 to get real value (CVD does NOT work)
'-- Date = 8
'-- Variant = 16
'---------------------------------------------------------------------
'</CSCM>
Public Function Peek(ByVal lngAddr As Long, _
ByVal lngBytes As Long) As String
Peek = Space$(lngBytes)
CopyMemory ByVal Peek, ByVal lngAddr, ByVal lngBytes
End Function
Public Sub PokeLng(ByVal lngAddr As Long, _
ByVal lngValue As Long)
Call CopyMemory(ByVal lngAddr, lngValue, 4&)
End Sub