Alright I have been using the DIM ... AT to create a pointer array to allow a DLL to read and change Array data from my main program.
This works great, except when I tried doing it with a Multidemsional UDT Array (although the UDT probably has nothing to do with it).
Here's an example:
DLL Code:
Program Code:
For some reason every array element in my DLL is the same as value as MyArray(1,1). I've tried MyArray(0) and MyArray(0,0), which as expected don't work at all. Do I have to pass the Array differently if its multidimensional? Or do I need to handle it in the DLL different?
This works great, except when I tried doing it with a Multidemsional UDT Array (although the UDT probably has nothing to do with it).
Here's an example:
DLL Code:
Code:
GLOBAL MyArray() AS MyUDT SUB LinkArray ALIAS "LinkArray" (BYREF ArrayPtr AS MyUDT, BYVAL ArrayCnt AS LONG) EXPORT REDIM MyArray(1 TO 3, 1 TO ArrayCnt) AS MyUDT AT VARPTR(ArrayPtr) END SUB
Code:
LinkArray MyArray(1,1), 3
Comment