The VB2TheMax Team Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (dest As _ Any, source As Any, ByVal bytes As Long) ' read a byte" name="description" />

Readabyte,integerorlongfrommemory

发表于:2007-05-25来源:作者:点击数: 标签:Readabyte
Date: 6/17/2000 Versions: VB 4/32 VB5 VB6 Level: Intermediate Author: vb 2themax.com"> The VB2TheMax Team Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (dest As _ Any, source As Any, ByVal bytes As Long) ' read a byte
Date: 6/17/2000
Versions: VB4/32 VB5 VB6 Level: Intermediate
Author:
vb2themax.com">The VB2TheMax Team

Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (dest As _
    Any, source As Any, ByVal bytes As Long)

' read a byte from memory

Function PeekB(ByVal address As Long) As Byte
    CopyMemory PeekB, ByVal address, 1
End Function

' read an integer from memory

Function PeekI(ByVal address As Long) As Integer
    CopyMemory PeekI, ByVal address, 2
End Function

' read a Long value from memory

Function PeekL(ByVal address As Long) As Long
    CopyMemory PeekL, ByVal address, 4
End Function

原文转自:http://www.ltesting.net