Hi,
Firstly, my apologies. I meant the subject to say, "Passing a multi dimensional array to a C++ DLL"
I want to offload some time consuming tasks to a C++ DLL and I am having a bit of trouble with one aspect of it.
I want to pass a two dimension array to the DLL but every time I run my MQL4 script I get the following error
If I use single dimension arrays then there is no problem and it all works as expected. My issue only occurs if I try to pass a 2 dimensional array to the DLL. Can I only pass single dimension arrays from MQL?
The MQL code is as follows and is compiled as a 32 bit DLL:
And my C++ code is as follows:
Thanks for any help,
John
Firstly, my apologies. I meant the subject to say, "Passing a multi dimensional array to a C++ DLL"
I want to offload some time consuming tasks to a C++ DLL and I am having a bit of trouble with one aspect of it.
I want to pass a two dimension array to the DLL but every time I run my MQL4 script I get the following error
QuoteDislikedCannot find 'ProcessFFTW' in 'DLLTest1.dll'
unresolved import function call
If I use single dimension arrays then there is no problem and it all works as expected. My issue only occurs if I try to pass a 2 dimensional array to the DLL. Can I only pass single dimension arrays from MQL?
The MQL code is as follows and is compiled as a 32 bit DLL:
Inserted Code
#import "DLLTest1.dll" void ProcessFFTW(double &inputArray[], double &outputArray[][2], int, double); #import void OnStart() { double threshold = 5.0; double inputArray[]={1.5, 2.6, 3.7, 4.8, 5.9}; int count = ArraySize(inputArray); double outputArray[][2]; ProcessFFTW(inputArray, outputArray, count, threshold); Alert(outputArray[2][2]); }
And my C++ code is as follows:
Inserted Code
#include "stdafx.h" #define MT4_EXPFUNC __declspec(dllexport) MT4_EXPFUNC void _stdcall ProcessFFTW(double *input[], double *output[][2], int barCount, double threshold) { output[2][2] = input[2]; }
Thanks for any help,
John