So, I'm basically looking to know how to turn this
BYTE *b
func(b);
into VB6 when b is a dynamic array that has already been redim'ed. Would it be
func(b)
or
func(VarPtr(b))
Thanks, iDomo.
You can do both, really.
But the easy way is func(b), where func is something like func(b() as byte). The b array is then passed by reference.
Declared?Private Declare Function ReadProcessMemory Lib "kernel32.dll" (ByVal hProcess As Long, ByVal lpBaseAddress As Long, ByRef lpBuffer As Any, ByVal nSize As Long, ByRef lpNumberOfBytesWritten As Long) As Long, and you would pass b(lbound(b)) for the third param. The function will receive the pointer to the first byte of the array. Do not omit ByVals, they are important.