I'm currently trying to impliment my own c++ wrapper for my c# dll for mql5 interop. I have an issue with adding c# dll reference to my c++ library. Could you please clarify the following sentence "...add the CLR support, System.dll, QExport.dll, Qexport.Service.dll to the build reference". I was able to register my dll with regasm utility, add it to the gac and obtain a .tlb type definition file. My problem is I cannot find any #import or #include statements in the source code you provided. Your project seems to reference your dll libraries in some mysterious way. Could somebody please explain a proper way to add a reference to .NET dll to a c++ library? Even though it's not a purely mql5 question it directly relates to the article. I've been researching the topic for quite a while now and still cannot understand how a c++ library can have .NET dlls in its "External Dependencies" without any #import statements. This is my first encounter with c++ and so far it hasn't been a pleasant one, I even thought to convert the .dll to .lib and add a reference to it, but before I do anything I decided to seek advice from a COM specialist. I'm running Windows 8 Ultimate x64 and compile my c# dlls with VS2012 Ultimate. Please help the novice.
Now not so many developers remember how to write a simple DLL, and what are special features of different system binding. Using several examples, I will try to show the entire process of the simple DLL's creation in 10 minutes, as well as to discuss some technical details of our binding implementation. I will show the step-by-step process of DLL creation in Visual Studio with examples of exchanging different types of variables (numbers, arrays, strings, etc.). Besides I will explain how to protect your client terminal from crashes in custom DLLs.
I'm currently trying to impliment my own c++ wrapper for my c# dll for mql5 interop. I have an issue with adding c# dll reference to my c++ library. Could you please clarify the following sentence "...add the CLR support, System.dll, QExport.dll, Qexport.Service.dll to the build reference". I was able to register my dll with regasm utility, add it to the gac and obtain a .tlb type definition file. My problem is I cannot find any #import or #include statements in the source code you provided. Your project seems to reference your dll libraries in some mysterious way. Could somebody please explain a proper way to add a reference to .NET dll to a c++ library? Even though it's not a purely mql5 question it directly relates to the article. I've been researching the topic for quite a while now and still cannot understand how a c++ library can have .NET dlls in its "External Dependencies" without any #import statements. This is my first encounter with c++ and so far it hasn't been a pleasant one, I even thought to convert the .dll to .lib and add a reference to it, but before I do anything I decided to seek advice from a COM specialist. I'm running Windows 8 Ultimate x64 and compile my c# dlls with VS2012 Ultimate. Please help the novice.
Quite stupidly I found I can reference c# dlls from c++ project by right clicking it and choosing References... in the dialog box. There's so much crap out there on the web.
shelandr1: Very interesting...Thank you...But maybe today there are easier ways*???
The article is good to tell about WCF to those who are unfamiliar with the technology. By the way, I checked WCF performance via Internet on the distance Peter - Odessa, I got a decent speed of about 14000 bilateral transactions/sec with 1kB packets. I personally like the technology for its object-oriented, that is not a stream of bytes is transmitted (although you can do it), but instances of classes, that is at the receiving end do not need to decode this stream.
And on the topic of quotes - it is easier to use memory mapping. We start a separate task with a mutex in a .NET application, MQL4 loads data into memory and resets the mutex, after which the application reads the data. It's easier and faster, and you don't need a DLL. It is only necessary to add system DLLs in MQL4 to support mapping and mutexes, there was a recent article on this topic.
I managed to get both this working with both 32bit MT5 and, after recompling for x64, managed to get it working with 64bit MT5....however, when I try to run the EA in the strategy tester they both crash spectacularly.
I would like to use this to export some price and indicator data into a database table to do some analysis with external software.....any ideas what could be causing this crash? This is the closest I've come to a working solution so far.
Joe
Hi Joe,
Was there any special trick to get it working on x64? I've just compiled it for x64, but the dll crashes with weird errors on startup.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
i got crash in strategy tester too. in normal mode, it's ok.
is anyone got solution yet?
Awesome work Alexander. I had never coded in C# before and I was looking at getting MT5 quotations to flow through in Excel without using DDE-Server.
I finally made it work by tweaking your code with MT5 32 bits. Next step x64.
SM
TradePlatform.NET
I'm currently trying to impliment my own c++ wrapper for my c# dll for mql5 interop. I have an issue with adding c# dll reference to my c++ library. Could you please clarify the following sentence "...add the CLR support, System.dll, QExport.dll, Qexport.Service.dll to the build reference". I was able to register my dll with regasm utility, add it to the gac and obtain a .tlb type definition file. My problem is I cannot find any #import or #include statements in the source code you provided. Your project seems to reference your dll libraries in some mysterious way. Could somebody please explain a proper way to add a reference to .NET dll to a c++ library? Even though it's not a purely mql5 question it directly relates to the article. I've been researching the topic for quite a while now and still cannot understand how a c++ library can have .NET dlls in its "External Dependencies" without any #import statements. This is my first encounter with c++ and so far it hasn't been a pleasant one, I even thought to convert the .dll to .lib and add a reference to it, but before I do anything I decided to seek advice from a COM specialist. I'm running Windows 8 Ultimate x64 and compile my c# dlls with VS2012 Ultimate. Please help the novice.
Very interesting...Thank you...But maybe today there are easier ways*???
The article is good to tell about WCF to those who are unfamiliar with the technology. By the way, I checked WCF performance via Internet on the distance Peter - Odessa, I got a decent speed of about 14000 bilateral transactions/sec with 1kB packets. I personally like the technology for its object-oriented, that is not a stream of bytes is transmitted (although you can do it), but instances of classes, that is at the receiving end do not need to decode this stream.
And on the topic of quotes - it is easier to use memory mapping. We start a separate task with a mutex in a .NET application, MQL4 loads data into memory and resets the mutex, after which the application reads the data. It's easier and faster, and you don't need a DLL. It is only necessary to add system DLLs in MQL4 to support mapping and mutexes, there was a recent article on this topic.
I managed to get both this working with both 32bit MT5 and, after recompling for x64, managed to get it working with 64bit MT5....however, when I try to run the EA in the strategy tester they both crash spectacularly.
I would like to use this to export some price and indicator data into a database table to do some analysis with external software.....any ideas what could be causing this crash? This is the closest I've come to a working solution so far.
Joe
Hi Joe,
Was there any special trick to get it working on x64? I've just compiled it for x64, but the dll crashes with weird errors on startup.