L
Luke
I am trying to convert some VB6 projects to VB.NET, however I'm having
trouble finding documentation of a new format for some functions, in
specific ReadProcessMemory. Since .NET no longer supports the 'as any'
declare I found myself trying integers & longs, however all attempts throw
back the error message 'Object reference not set to an instance of an
object.'.
My API declare is as follows
Public Declare Function ReadProcessMemory Lib "kernel32" Alias
"ReadProcessMemory" (ByVal hProcess As Long, ByVal lpBaseAddress As Integer,
ByVal lpBuffer As String, ByVal nSize As Integer, ByVal
lpNumberOfBytesWritten As Integer) As Integer
and the calling code is:
ReadProcessMemory(vProcessID, 16777216, vOut, 1, vNum)
at the time of calling, vProcessID is assigned the processID, 16777216 is
the base address of memory to be read in dec. vOut is an empty string and
vNum is an empty integer. I'm sure this will be an easy one for someone and
I'd appreciate the help.
Regards,
Luke
trouble finding documentation of a new format for some functions, in
specific ReadProcessMemory. Since .NET no longer supports the 'as any'
declare I found myself trying integers & longs, however all attempts throw
back the error message 'Object reference not set to an instance of an
object.'.
My API declare is as follows
Public Declare Function ReadProcessMemory Lib "kernel32" Alias
"ReadProcessMemory" (ByVal hProcess As Long, ByVal lpBaseAddress As Integer,
ByVal lpBuffer As String, ByVal nSize As Integer, ByVal
lpNumberOfBytesWritten As Integer) As Integer
and the calling code is:
ReadProcessMemory(vProcessID, 16777216, vOut, 1, vNum)
at the time of calling, vProcessID is assigned the processID, 16777216 is
the base address of memory to be read in dec. vOut is an empty string and
vNum is an empty integer. I'm sure this will be an easy one for someone and
I'd appreciate the help.
Regards,
Luke