>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
Rolf Kalbermatter
My Blog 
DEMO, Electronic and Mechanical Support department, room 36.LB00.390