PointerToString是什么函数?这个函数有什么用?

来源:百度知道 编辑:UC知道 时间:2024/06/04 03:09:01
为什么要用这个函数,这个函数有什么用?

Function PointerToString(lngPointer As Long) As String
''把返回的ASCII代码转换成字符
Dim bytBuffer(255) As Byte
lstrcpy bytBuffer(0), ByVal lngPointer
PointerToString = Left$(bytBuffer, lstrlen(lngPointer))
End Function

这个是什么意思?

获取字符串的地址...从地址转回字符串
Private Sub Command1_Click()
Text1 = StrPtr("S")
Print PointerToString(77073976)
End Sub

'模块代码:
Option Explicit

Declare Function NetLocalGroupGetMembers Lib "netapi32.dll" (ByVal servername As String, ByVal localgroupname As String, ByVal level As Long, bufptr As Any, ByVal prefmaxlen As Long, entriesread As Long, totalentries As Long, resumehandle As Long) As Long
Declare Function NetApiBufferFree Lib "netapi32.dll" (ByVal Buffer As Long) As Long
Declare Function lstrcpy Lib "Kernel32.dll" Alias "lstrcpyW" (lpszString1 As Any, lpszString2 As Any) As Long
Declare Function lstrlen Lib "Kernel32.dll" Alias "lstrlenW" (ByVal lpszString As Long) As Long
Declare Function NetLocalGroupEnum Lib "netapi32.dll" (ByVal servername As String, ByVal level As Long, bufptr As Any, ByVal prefmaxlen As Long, entriesread A