Discussion of article "How to Exchange Data: A DLL for MQL5 in 10 Minutes" - page 2

 
LEHayes:

...

 It's all well and good that you bring it up, but it does no one anygood to complain about it, if they are not willing to present solutions or even suggestions on how to achieve the goal.

...

Actually it's good that pfx brought and complained about it and MetaQuotes should resolve this issue, coz they know MetaTrader, better than the rest of us (BTW, Renat Fatkhullin, the author of this article, is also CEO of MetaQuotes). Just because someone brought that up that doesn't make him/her has a the solutions to the issue. 

And I agree, that it is not making any sense saying "It's better to make infrequent calls", when .dll is actually being called on every tick. And it's good to hear that from MetaQuotes CEO, honesty is good for a change these days.

@ pfx, looks like they change the paragraph you quoted from ...

5. DLL calls wrapper and loss of speed on calls

As already described above, every call of DLL functions is wrapped into a special wrapper in order to ensure safety. 

This binding masks the basic code, replaces the stack, supports stdcall / cdecl agreements and monitors exceptions within the functions called.

This work inevitably leads to delay of the calling function. 

Therefore, it isn't recommended to perform very frequent DLL function calls (hundreds or thousands of times per second) for small operations. 

It's better to make infrequent calls.

 ..to this one ...

5. DLL calls wrapper and loss of speed on calls

As already described above, every call of DLL functions is wrapped into a special wrapper in order to ensure safety. This binding masks the basic code, replaces the stack, supports stdcall / cdecl agreements and monitors exceptions within the functions called.

This volume of works doesn't lead to a significant delay of function calling.

I hope they really solve this lost of .dll call speed issue, and not just changing some paragraph of the article to avoid questions.

Speaking about questions, I hope Renat Fatkhullin, would like to answer pfx question of " I mean seriously what sort of statement is that ", coz Renat wrote on final line of the article, "Thank you for your interest! I am ready to answer any questions", or at least the change of the paragraph.

We interested to hear your answer too :).

I'll write more about this when I have time.

 

I do not know when Renat wrote this article, but Microsoft are no longer offering Visual Studio 2005. They offering Visual studio 2010 and 2011 beta and it looks like about to dump 2008. 

Click here for Microsoft Visual Studio 2010 , and click here for the 2008. The installer is web installer which is annoying if you have slow internet connection,. They offer offline installer as ISO image but that also contain Visual Studio C# and Visual Basic. After installing, both Studio require some updates which is big as well in MB size.

For those who doesn't like installing Visual Studio, there are other alternatives which you can look at https://en.wikipedia.org/wiki/Comparison_of_integrated_development_environments. My favorites is NetBeans and Code::Block. NetBeans is supported by Oracle and base for their Oracle Solaris Studio. However NetBeans does not comes with compiler so you have to figure the Cygwin or MinGW compiler which is maybe annoying for a newbieLatest stable of famous DevC++ was 7 year ago, now it's website is full of dead links, looks like no one taking care of them anymore, so I won't recommend it.

It's better to use Visual Studio though, coz there's plenty of options you can play with - if you know how. 

Download Overview
  • www.microsoft.com
Download free 90-day trials of Visual Studio products, free Visual Studio Express products, and additional Visual Studio software.
 
onewithzachy:

Speaking about questions, I hope Renat Fatkhullin, would like to answer pfx question of " I mean seriously what sort of statement is that ", coz Renat wrote on final line of the article, "Thank you for your interest! I am ready to answer any questions", or at least the change of the paragraph.
There is no deceleration on DLL calls.
 

Anyone know how to create a 64 bit DLL or allow MQL5 to load a 32 bit DLL? MQ5 is not loading my test script because my DLL is "not 64-bit". Thanks.
 

It is good thnx
 

Very Good tutorial !

need i create files reference ?

 

I need to modify Fann2MQl.dll (documented in http://fann2mql.wordpress.com) because is not functional in MT5. The reason is that in MT5 you cannot open files where you like. They have to be opened in 2 default places (for forward mode and testing mode).

 

So the question is what function to invoke instead of fopen and what header file include ? Because it seems that files have to be open from inside MT5. Any attempt to open a file bypassing terminal.exe (as it happens using fopen from a dll) is automatically forwarded either to the Installation Directory or to the Desktop, according to the mode of launching terminal.exe employed (cliking the icon or from the command line with parameter /portable).

 

This forwarding is besides bizarre, because the resulting name of the file is only in the first leter of the path to it.

About
  • fann2mql.wordpress.com
Fann2MQL is a Neural Network processing package for MetaTrader4. It enables you to write your own Expert Adviser or Indicator taking advantage of Fast Artificial Neural Network Library. It’s very simple and efficient. You can use up to 1024 network simultaneously without recompiling it and in case you need more power it lets you perform...
 
RyanLeland:

Anyone know how to create a 64 bit DLL or allow MQL5 to load a 32 bit DLL? MQ5 is not loading my test script because my DLL is "not 64-bit". Thanks.

This can be fixed, instructions here: Solution Explorer -> Right Click Solution -> Configuration Manager -> Active solution platform drop down menu -> select x64 -> click Close -> Rebuild Solution

Hope this helps.

Good luck.

 

Hello,

This does not work with DLL produced by Microsoft Visual Studio 2013 Express edition, see attached.

It does not seem to find the library MSVCR120D_APP.DLL and an issue with KERNEL_32 as well. 

Has anyone got similar issue? How can I workaround this, please?

Thank you

 

Does mql5 support import dll which include callback functions?

 

for example:

There's a dll named tclient.dll, which include function below:

typedef TCLIENT_API void(*call_back)(Tick* p); 

TCLIENT_API int sub_tick(CTX ctx, const char* insId, call_back f);  

 

Then how should I declare and call sub_tick in mql5?

#import "tclient.dll"

//how to declare function "sub_tick" 

#import 

 

void ontick(Tick &ticks[])

{}

int OnInit()

{

//how to call function "sub_tick"? 

Reason: