Discussion on "How to write a DLL for MQL5 and exchange data in 10 minutes". - page 8
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
DLL function declaration
Calling a DLL functionIn the last example, you also made some changes to the dll, didn't you?
That's what I mean.
Could you give me a hint as well, if it's not too much trouble. There is a dll, a text value is passed to it, the output is a number in type string
For example like this:
I can't fix the dll due to lack of knowledge. Please advise how to make a correct code for passing it to dll, and how to receive it correctly. I have a feeling that my dll will not work in MT5.
Thanks in advance for the help.
Could you give me a hint as well, if it's not too much trouble. There is a dll, a text value is passed to it, the output is a number in type string
I cannot fix the dll due to lack of knowledge. Please advise how to correctly write the code to submit it to the dll, and how to get it properly. Because my dll doesn't work in MT5 right now.Thanks in advance for your help.
I rechecked work with string return from DLL and found error in x64 (appeared after some optimizations). Correction will be included in the next build.
If you are working in x64, please wait for build release.
The only thing I can add, please remember that MQL5 works with Unicode strings.
Published article How to write a DLL for MQL5 in 10 minutes and exchange data?:
Author: Renat Fatkhullin
Thanks for the article. I have already used it.
The tip is very good. But ! It took me 10 minutes to figure out how to set the DLL path correctly in VS2010.
It turned out to be like this:
C:\Users\пп\AppData\Roaming\MetaQuotes\Terminal\D0E8209F77C8CF37AD8BF550E51FF075\MQL5\Libraries
I suggest to copy path from MetaEditor.
Or specify your own path in enviroment (did not check it).
And another thing, how do we deal with multithreading?
Thanks for the article. Repeated it in full, but I want to say a few words about what I encountered during implementation - these seemingly small things almost put me off. What I wanted to clarify (using VS2010 + MT5 (32 bit) build 756 + Win 7 Maximum x64):
Otherwise not a bad article... Respect!
On 64 bit MT5 example does not work. Terminal reports that it is 32-bit DLL and does not connect it. But under Win32 (as in this example and in all other examples - like in Delphi) - all DLLs are 32-bit. Like in previous post, I have to uninstall 64-bit version of the terminal and install 32-bit one. I also need to know how to do it since the 64-bit version is installed by force. It turns out that MT5 64 bits is a dead terminal, I do not know why it is released. Dear developers, if it is possible, please make it possible to connect a 32-bit DLL to МТ5 64 bits.
If this is technically impossible or difficult, write the pitfalls that this version will not work with 32-bit DLL and users suffer and can not understand what is wrong. And write openly that the folder Libraries is not in the directories of the terminal itself, and knows where, and without experience will not find, do not even try. By the way, in this secret place there are all indicators and experts, so installing MT5 you can forget about them - if you don't know that all this is in a hidden folder C:\Users\nAppData\Roaming... ...or the user thinks he's installing a well-written program, which is a hoax.
You should improve your technical level.
For 64-bit programs you need 64-bit libraries and there is no way you can reasonably connect 32-bit libraries. To install the 32 bit version, the installer must be run with the /32 switch
I will rewrite the article and add cool features that have long been implemented in MetaEditor and MT4 and MT5 platforms. Many developers are not aware of the new features.