How to import DLL that returns array

 

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? 

 
It seems that it doesn't matter if I'm trying to return an array or not. I get the error if I even try to return just a single struct, but it compiles if I change the return type to an int or a float.
 
AFAIK, you can't import structs from DLLs. Use standard types instead. To return an array of doubles, for example, you should pass array of doubles by reference into DLL function and it will fill it with output.
 
I know this is 5 years later, but thank you very much! I was having same problem.
 
You can't return an array. Pass the array by reference and populate it.
Reason: