已知一个变量的地址,但不知道它的名称,如何取得数据?
谢谢!!
谢谢!!
解决方案 »
- 冰天雪地裸体割脉跪求[如何对超大文本文件进行一个统一的小操作]????
- 关于身份证判断(textbox)
- VB和水晶报表9的问题
- 为什么使用vb6.0的winsock接收数据时接收的数据不完整????(急!在线等待)
- VB和SQL打包问题?
- vb+TTS开发简易语音识别程序
- 关于MSHFlexGrid代码填充时出现的隐藏行问题,麻烦各位高手帮忙解答,谢谢!!
- 如何不用配置ODBC,就可以实现客户端和服务器的数据库相连?
- 如何通过VB利用API调用实现全局HOOK。
- 如何知道一个 IE 窗口启动!
- 怎样一个frame中放两组不相干的optionbutton?在线等待!
- 请问:如何使我在vb中调用的程序,在我的form中显示和运行?
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (dest As _
Any, source As Any, ByVal bytes As Long)
Private Declare Function lstrlenA Lib "kernel32" (ByVal lpString As Long) As _
Long
Private Declare Function lstrlenW Lib "kernel32" (ByVal lpString As Long) As _
Long' retrieve a string at a given address
' if LENGTH < 0 the string is considered to be null-terminated
' and the function determines its lengthFunction StringFromAddr(ByVal address As Long, ByVal length As Long, _
Optional ByVal isUnicode As Boolean) As String
' determine the length, if necessary
If length < 0 Then
If isUnicode Then
length = lstrlenW(address)
Else
length = lstrlenA(address)
End If
End If
' copy the characters
StringFromAddr = Space$(length)
If isUnicode Then
CopyMemory ByVal StrPtr(StringFromAddr), ByVal address, length * 2
Else
CopyMemory ByVal StringFromAddr, ByVal address, length
End If
End Function--------------------------------------
读取字节,整数,长整数
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (dest As _
Any, source As Any, ByVal bytes As Long)' read a byte from memoryFunction PeekB(ByVal address As Long) As Byte
CopyMemory PeekB, ByVal address, 1
End Function' read an integer from memoryFunction PeekI(ByVal address As Long) As Integer
CopyMemory PeekI, ByVal address, 2
End Function' read a Long value from memoryFunction PeekL(ByVal address As Long) As Long
CopyMemory PeekL, ByVal address, 4
End Function
请问调用函数CopyMemory的时候第二个参数用ByVal address是什么意思?什么情况要这样用啊?
是不是指把address的值当地址传过去?