rolf <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>...
> >So basically my function is valid (although I have to switch rows and
> >columns for a valid result) and all I need is to make a LabView
> >program that allocates a 2d-array and passes it to this dll function?
> 
> Well, not sure about switching columns and rows really, you will have
> to try this out. My change is in the type of the matrix parameter.
> Compare it to your original code.
> 
> >>int MyDllFunction(unsigned char **matrix, int width, int height)
> 
> int MyDllFunction(unsigned char *matrix, int width, int height)
> {
>      for (int r = 0; r < height; r++)
>      {
>         for (int c = 0; c < width; c++)
>            matrix[r * width + c] = SomeData(r, c);
>      }
>      return 1;
> }
> 
> Rolf K

Thanks a lot! I'll try it out. To me it seems quite strange to be
using a single pointer though. But, then again, I don't really know
how LabView works =).

Reply via email to