> Any idea why ? Ever debugged it ?
>
>
> Something else about the array argument initialization (for the write
> function above). I pass an empty array constant from LabVIEW, while the
> array is declared with a defined max lengh in the C source. Does that
> mean trouble ? Should I pass an initialized array ?
>
I think you need to build a debug version of your DLL and set a
breakpoint in the init. I think you will find that either one of the
calls there is causing the exception, or it is corrupting some memory
that LV tries to access on return. The LV array is a dynamic structure
that can change size in the DLL, but it is not the same as the [] array
in C, which is really just indexing math added to a pointer either
malloced, in a global, or on
the stack. The header file extcode.h has
functions for dealing with LV arrays, and you may want to take a minute
to work through an example to learn a bit about LV datatypes.
In LV, make a DLL node that passes an array and perhaps a few other
types in. Popup on the node and create .c file. The call will show you
some typedefs you can use the manipulate and access the LV arrays. You
can also experiment and see the difference between the choices for
passing arrays as pointer, handle, etc.
Greg McKaskle