DLL that returns array
you must pass the array by reference. Even in pure mql4 it is not allowed to return any other things than double, int or string as return vaues. Returning arrays can only be achieved by passing as argument by reference.
in mql you declare it like
void foo(double &bar[]);
and in your DLL you will receive a pointer to an array of double. You can then dereference this and read and write to this array.
in mql you declare it like
void foo(double &bar[]);
and in your DLL you will receive a pointer to an array of double. You can then dereference this and read and write to this array.
Yes, you are right.
But this way was not suitable for me because I use .NET dlls and allocating unmanaged memory is impossible (or at least an overkill) from .NET.
So if you write unmanaged code it is better to follow 7bit's way.
But this way was not suitable for me because I use .NET dlls and allocating unmanaged memory is impossible (or at least an overkill) from .NET.
So if you write unmanaged code it is better to follow 7bit's way.
float* getArray(float* input)
{
//
//
//
// Process
//
//
return value;
}
How do I import the DLL and make use of it?
Am I allowed to use pointers in MQL4?
#import "test.dll"
float* getArray(*float input);
#import
Thanks in advance