Download MetaTrader 5

DLL return array

To add comments, please log in or register
Lexeon
14
Lexeon 2016.07.30 08:22 

I have a DLL that will return a pointer to an array of structs:

struct dataSet{

        //some random variables

}; 

dataSet* RandomFunction(const int ratesTotal, const double price[]) { 

        //some random calculations

}

However, I do not know how to import this function in mql5. I have tried doing

#import "RandomDLL.dll"
   dataSet[] RandomFunction(const int ratesTotal, const double& price[]);
#import

 However when I compile my code I get two errors:

'[' - name expected

'double' - name expected

 

I assume the 'double' error is just residue from the return type not being correct. Does anyone know how to properly import a function from a DLL that returns a pointer to an array? 

To add comments, please log in or register