thanks, but I used your code and in shared library wizard I got this error :
_declspec(dllexport) MgErr GetArray(Int2DArrHdl* arr, size_t dim_x, size_t dim_y);
Undefined symbols can prevent the wizard from recognizing functions and parameters. To correct this problem, check the header file to determine if you must add preprocessor definitions. Click the Back button to return to the previous page of the wizard to add a preprocessor definitionsl (for example, "NIAPI_stdcall = __stdcall" or "NIAPIDefined = 1").
The following header file was not found in the specified header file or one of the referenced header files:
- extcode.h
- lv_prolog.h
- lv_epilog.h
To fix, click the Back button to go to the previous page and add the header file path to the Include Paths list.
after all this I think the problem is mostly using shared library wizard and the best choice is using call library function node
can I allocate an array in c and after initializing it copy its data to an array like here to pass the array data?
by the way my data is large like 3000*3000 and I might get access violation error running my dll vi.
#include "extcode.h"
_declspec(dllexport) void ARRAY2D(double *array,
int array_length_row,
int array_length_col);
_declspec(dllexport) void ARRAY2D(double *array,
int array_length_row,
int array_length_col)
{
int i, j;
for(i = 0; i < array_length_row; i++)
{
for(j = 0; j < array_length_col; j++)
{
array[(i * array_length_col) + j] = array[(i * array_length_col) + j] *
array[(i * array_length_col) + j];
}
}
}