Discussion of article "How to Export Quotes from МetaTrader 5 to .NET Applications Using WCF Services" - page 2

 
Thank you! Very useful introduction to both wcf and mql5
 

i got crash in strategy tester too. in normal mode, it's ok.

is anyone got solution yet?

 
Thanks for your great work!
 

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 

 
recently saw another free way to program C# for MetaTrader
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.
How to Exchange Data: A DLL for MQL5 in 10 Minutes
  • 2010.01.27
  • MetaQuotes Software Corp.
  • www.mql5.com
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.
 
Burton:

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.
 
That's very interesting. Thank you. But maybe there are simpler options today.
 
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.

 
joeykruger:

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.