2
이것은 내 코드의 조각입니다.ReadProcessMemory의 출력에서 문자열을 얻는 방법
Declare Function ReadProcessMemory Lib "kernel32" _
(ByVal hProcess As Long, _
ByVal lpBaseAddress As Long, _
lpBuffer As Any, _
ByVal nSize As Long, _
lpNumberOfBytesRead As Long) As Long
Dim bytearray As String * 65526
Dim GetWindowsFormsID
ReadProcessMemory(processHandle, bufferMem, ByVal bytearray, size, lp)
GetWindowsFormsID = ByteArrayToString(bytearray, retLength)
Function ByteArrayToString(bytes As String, length As Long) As String
Dim retValStr As String
Dim l As Long
retValStr = String$(length + 1, Chr(0))
l = WideCharToMultiByte(CP_ACP, 0, bytes, -1, retValStr, length + 1, Null, Null)
ByteArrayToString = retValStr
End Function
WideCharToMultiByte를 호출하는 동안 '94 null '오류가 발생했습니다. 그러나 바이트가 비어 있지 않은 것은 확실합니다.
이 문자열에이 출력을 변환 할 수있는 정확한 절차인가?