At the moment I'm working on using an API function to get the address of an array which contains a bunch of Singles and then I wanna try to read each succesive byte into a byte array.
Using the advice above I have now stored an array of Singles in a Byte array.
The only problem is the array of Singles is two dimensional. If it was only a single dimension I would know that I can create a Single on every forth byte in the Byte array and that would enable me to rebuild the Single array.
With a two dimensional array I need to know when a new 'column' in the second dimension starts so that I can recreate it.
I've tried setting one of the entries in the byte array to NULL enabling me to iterate through the Byte array and start a new column in the rebuilt Single array every time I encounter a NULL.
However, I have found that its not possible to assign a value of NULL to a byte.
Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" _
(ByRef lpvDest As Any, ByRef lpvSource As Any, _
ByVal cbCopy As Long)
example...
Dim bytLongs(0 to 3) '4 bytes only for 1 long, increase as needed
Dim lngPointer as Long
Dim lngNumber as Long
lngPointer = 0
lngNumber = 4563
CopyMemory(bytLongs(lngPointer), lngNumber, 4)
'increment lngPointer by 4 before copying next long value to byte array
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.