Discussion on "How to write a DLL for MQL5 and exchange data in 10 minutes". - page 9

 
Renat:

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.

Thanks Renat for your reply. Nowadays the markets are rather complicated, and trading takes you almost out of your depth and there's almost no time to improve in technical area. I really do not understand the difference between 32-bit and 64-bit programs. I can only see that it creates some unnecessary problems for users. Everyone is driving somewhere and Microsoft including, they want to get faster and more abruptly but users encounter only problems. I don't see any difference in speed between 64-bit and 32-bit. However, my processor is i7-4 - the latest Intel, maybe because of this. I also see that Microsoft are compressing C++. They even removed the option of working with C++ forms in the last compiler. And when I asked why? The answer is why don't you try the new and more perfect C++. So, if you are looking into the future, you should take it into account as well.
 
ANG3110:


And I see that Microsoft started compressing C++. In the latest compiler they even removed the ability to work with forms in C++. And when I asked why? The answer is why don't you try the new and improved C++. So, if you look into the future, you should take it into account too.

Well Microsoft is a notorious technology killer, and lately has been digging its own grave after grave.

Why interfere with it - let it fall into its own hole. It is so figuratively, not to waste time on technical details. Who wants details - there are thousands of them on the Internet. After "better C#" I have no other words.

 
:)
 
Colleagues, how do I connect MT libraries in VS? so that my studio doesn't underline string, datetime...
 
Renat Fatkhullin:

You should improve your technical level.

For 64-bit programs you need 64-bit libraries and there is no way you can connect 32-bit libraries in a reasonable way. To install the 32-bit version you have to run the installer with /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.

Is there an example to create a 64-bit dll for the 64-bit version of the terminal? And about "cool stuff" it is interesting to know)
 

It turned out to be easy!

Installed the free Visual Studio Community 2015 (exactly Community, as it has x64 support, unlike Express) The paid versions have x64 too of course, but I was looking at the free options. Web Installer gave me an error, so I installed from the ISO image. When installing, select "Custom" installation and check C++ (it's not installed by default).

Then I did everything as described in the article, i.e. created a Win32 project. Made an assembly, which the x64 terminal refused to accept (as expected).

Then in the "Build" -> "Configuration Manager" tab I changed the platform to x64, (you can also change the "Active Solution Platform" to x64)


Built it again. New dll turned out to be in \x64\Debug folder (final build will be in x64\Release\), that x64 terminal processed without problems and returned the following output:

19:29:01.883 dll_test (EURUSD.e,H1) Time 16 msec, int: -752584127 double: 17247836076609.0
19:29:01.883 dll_test (EURUSD.e,H1) Array: 0 1 2 3 4 5 6 7 8 9
19:29:01.883 dll_test (EURUSD.e,H1) Replace: A quick brown cat jumps over the lazy dog
19:29:01.886 dll_test (EURUSD.e,H1) Access violation at 0x000007FEFB0F176F write to 0x0000000000000000 in '...\MQL5\Libraries\ConsoleApplication1.dll'
and further description of intercepted error
I.e., everything works!!!

Downloads | Visual Studio
Downloads | Visual Studio
  • www.visualstudio.com
Visual Studio Community 2015 with Update 1 - Free Visual Studio Community 2015 with Update 1 is a free, fully featured, and extensible IDE for individual developers, open source projects, academic research, education, and small professional teams. Create applications for Windows, Android, and iOS as well as web applications and cloud services...
 

Note:

When transferring the DLL to another computer, it refused to work because it was using components from VS itself. The problem is solved in Project -> Properties -> Use MFC, set to "Use MFC in static library". After that rebuild and recompile the DLL

Found on the forum:

It is possible to optimise EAs with DLLs not only on the local computer, but also on a local network. To do this on network computers, add /dlls key to the registry for test agents. Call registry editor: regedit

Renat Fatkhullin:

For existing installed agents, the startup commands can only be changed via the registry in the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MetaTester-XXXX branches

Simply click on each ImagePath parameter and add /dlls to the end of the line


 

I'm in the process of binding ZeroMQ to MT4 via DLL.

It is very bad somehow. The terminal crashes all the time when starting the indicator or when unloading. And it doesn't show up in debug mode, so I don't know what's going on.

 

Good afternoon.

For some reason, when I run the test example, the script crashes at the first call to the imported function

2016.07.30 23:30:14.088 Scripts script mql5dll_test (EURUSD,H1) removed

What am I doing wrong?

 
EsEr:

Good afternoon.

For some reason, when I run the test example, the script crashes at the first call to the imported function

2016.07.30 23:30:14.088 Scripts script mql5dll_test (EURUSD,H1) removed

What am I doing wrong?

this article is 6 years old, something must have changed.

What is the error code?