I am trying to write a simple test dll that will be called from a program written in MQL4. In MQL I create a two dimension array and want to pass it to a C++ funcion. This function will then modify some elements in the array and I want to be able to view these changes in the calling program.
I can do it with a single dimension array but I am well and truly stuck trying to get it to work with a two dimension array.
At the time that the function is called I know the number of columns in the array but I don't know how many rows there will be.
This is my simple test code
1 2 3 4 5 6 7 8 9
#define MT4_EXPFUNC __declspec(dllexport)
MT4_EXPFUNC void _stdcall ArrayTestingFunction(double* testArray)
{
double value = testArray[1][1];
// Change the value in the array and check for the new value in the calling EA
testArray[1][1] = value * 2;
}
This is the error I get when I try to compile the DLL
error C2109: subscript requires array or pointer type
If I hold the cursor over the word testArray I get the message "expression must have pointer-to-object type" displayed