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

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
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.
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.
Just posted a new job based on this article: https://www.mql5.com/en/job/34392 .
It's not working in my MT5 64 bits environment...
Great article!
Thanks
Just for knowledge, I discovered what happened in my 64 bits machine.
After hours and hours of researching and debugging, discovered that one referenced assembly was not loading, generating the exception "System.IO.FileNotFoundException: Unable to load file or assembly 'QExport.Service, Version=1.0.5771.13857, Culture=neutral, PublicKeyToken=56996a45dd1e337b'".
Maybe because the dll has no config file, don't know yet, MT 5 did not know where to find the assembly. So it was trying to get it in the base path (path where metaeditor64.exe is located). After changing the output directory of the referenced projects to that path, worked as a charm.
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.
Sabe, see my answer below.
[]'s