Download MetaTrader 5

How to call functions from Intel Fortran .dll?

To add comments, please log in or register
Does your signal already have a lot of of subscribers? It's time to think about the paid subscription!
olle.onkel
50
olle.onkel 2014.08.12 19:43 

Hello community,

Does anybody has experiences or links where I can find help with the above topic?

Today I wanted to test the interactions of MQL5 with a .dll created in Intel Fortran XE 2013 , VS2010. Executing a sample function of the dll leaded to the interruption of the EA  in debugging mode.

The compiler directive !DEC$ ATTRIBUTES DLLEXPORT ... within the fortran subroutines was used.

Any ideas what to consider additionally?


Thany you!

Olle Onkel

olle.onkel
50
olle.onkel 2014.08.16 15:47  
olle.onkel:

Hello community,

Does anybody has experiences or links where I can find help with the above topic?

Today I wanted to test the interactions of MQL5 with a .dll created in Intel Fortran XE 2013 , VS2010. Executing a sample function of the dll leaded to the interruption of the EA  in debugging mode.

The compiler directive !DEC$ ATTRIBUTES DLLEXPORT ... within the fortran subroutines was used.

Any ideas what to consider additionally?


Thany you!

Olle Onkel


Hello Olle Onkel!

1. beside the !DEC$ ATTRIBUTES DLLEXPORT... directive, use also have to add the !DEC$ATTRIBUTES ALIAS : "..." :: ... directive

2. don't forget to compile the dll corresponding to the Metatrader platform (x86/int64)

3. arrays must be static

4. functions are exported with capital letters, and have to be referenced accordingly

5. the fortranarray index starts with 1, and an fortranarray with two dimensions is reverse

6. for debugging the .dll, attaching the debugger to the terminal.exe seems to be impossible BUT: with adding the #property tester_library "xxxx.dll" it is possible to add the debugger to the metatester64.exe


Thats it so far! Good Luck!

Nathan123
43
Nathan123 2014.08.18 08:20  

By the way, talking about this, do you know whether it is possible to call an MQL5 function, such as PositionGetDouble(), from a DLL?

Thank you, cheers,

NA

To add comments, please log in or register