I have a problem. I can pass 2D array from Delphi to C++ DLL that created by CodeBlocks. My function in C++ DLL is :
double __declspec(dllexport) __cdecl mainFunction(double** arr, int64 length)
And my Function In Delphi to call DLL is :
type
DynMatrixDouble = array of array of double;
.
.
function arr(X:DynMatrixDouble; Y: integer):double; stdcall; external 'Array_dll.dll' name 'mainFunction';
This code works well and the values of the variables are transferred between the program and the dll.But when I convert a function that has a 2D array in input in Matlab to DLL or /to C++ to make DLL with CodeBlocks, It's no longer like the code above, this is :
double calc_det(int64m_T n, const emxArray_real_T *arr)
It seems I should make 2D Double array Variable In "emxArray_real_T" Type in Delphi and pass to DLL. I searched and reached the link below: How to convert float[][] type array to "emxArray_real_T *x" But I couldn't find the answer to my question.My question is how can define "emxArray_real_T" type in Delphi for 2D Array and send it to dll ? Can anyone help me how to do it right? Thanks.