| 首页 | 新闻 | 网页 | 设计 | 色彩 | 原创 | 视觉 | 素材 | 动漫 | 酷站 | 策划 | 文案 | 访谈 | 运营 | 编程 | 数据库 | 服务器 | 下载 | 图库 | 
您的位置: 幽幽天空 > 网页 > 编程开发 > VB教程 > 文章正文 用户登录
网络营销之google
BlogAds帮助blog盈
Google Adsense改
王通:Google应该
ad4all.net美通网
Google Adsense将
Google AdSense开
Google AdSense (
Google AdSense推
Google Adsense即

Read a string at a given address           

Read a string at a given address

作者:佚名 来源:csdn 作者: shuwork 更新:2006-8-25 21:05:35 错误报告 我要投稿
Date: 6/17/2000
Versions: VB4/32 VB5 VB6 Level: Intermediate
Author:
The VB2TheMax Team

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 length



Function 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

文章录入:skyuu    责任编辑:skyuu 
  • 上一篇文章:

  • 下一篇文章:
  • 【字体: 】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
    网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
    发表评论:
    姓名:  评 分: 1分 2分 3分 4分 5分
     
  • 严禁发表危害国家安全、政治、黄色淫秽等内容的评论。
  • 用户需对自己在使用幽幽天空服务过程中的行为承担法律责任。
  • 本站管理员有权保留或删除评论内容。
  • 评论内容只代表机友个人观点,与本网站立场无关。