Hello,
I am having trouble using ctypes to call a Dll function. In short, the function accepts a pointer to an array of structures....like:
int arrayFiller(
USHORT sensorID,
void *pRecord,
int recordSize
);
I have generated a pythonified version of the function by importing the Dll etc. We will call this function "pyArrayFiller"
To call pyArrayFiller, I need to generate the python version of the `void *pRecord` which is a pointer to an array of four structures as defined below:
The c-code for the structure looks like this:
typedef struct tagMyStruct
{
double x;
double y;
double z;
double a;
double e;
double r;
double time;
USHORT quality;
} MyStruct;
So I constructed a python version of the same structure:
class pyMyStructure(ctypes.Structure):
_fields_ = [("x", ctypes.c_double),
("y", ctypes.c_double),
("z", ctypes.c_double),
("a", ctypes.c_double),
("e", ctypes.c_double),
("r", ctypes.c_double),
("time", ctypes.c_double),
("quality", ctypes.c_double)]
Now, I would like to:
i.) create an array of 4 pyMyStruct()`s
ii.) generate a pointer to this array to pass to the 'pyArrayFiller' function.
Any tips? If this is a terrible/insufficient explanation, I can try again.
Thanks!