HI all,
I already interfaced a VC++ dll with Metatrader but now I would like to interface Matlab code with MQL code using a DLL.
I created a test.m file with only a simple function:
function output = AddTwo(x,y)
output = x + y;
then I created a Deployment project for a C++ Shared library, I added the test.m file and compiled everything making the dllTest.dll.
In a TestDLL.mq4 file I wrote:
#import "dllTest.dll"
double AddTwo( double x, double y )
#import
and in the body a simple:
Alert( AddTwo( 4.0, 6.0 ) );
Ofc it doesn't work, I obtain only a "cannot load library dllTest.dll (error 126)".
It seems a compilation problem. With my other Visual C++ DLLs I had a similar error solved changing the VC++ compilation parameter "Use of MFC" from "Use MFC in a Shared DLL" to "Use MFC in a Static Library"... but I don't know what to do in Matlab.
Anyone successfully used a Matlab dll in a MQL program, any hints?
Thx in advance.
I already interfaced a VC++ dll with Metatrader but now I would like to interface Matlab code with MQL code using a DLL.
I created a test.m file with only a simple function:
function output = AddTwo(x,y)
output = x + y;
then I created a Deployment project for a C++ Shared library, I added the test.m file and compiled everything making the dllTest.dll.
In a TestDLL.mq4 file I wrote:
#import "dllTest.dll"
double AddTwo( double x, double y )
#import
and in the body a simple:
Alert( AddTwo( 4.0, 6.0 ) );
Ofc it doesn't work, I obtain only a "cannot load library dllTest.dll (error 126)".
It seems a compilation problem. With my other Visual C++ DLLs I had a similar error solved changing the VC++ compilation parameter "Use of MFC" from "Use MFC in a Shared DLL" to "Use MFC in a Static Library"... but I don't know what to do in Matlab.
Anyone successfully used a Matlab dll in a MQL program, any hints?
Thx in advance.