- class import from c# dll in mql4
- Help required to call a C++ DLL function that expects a double pointer as function argument in MQL4
- Passing strings to dll files with complete example
Mql4 can not use c# DLLs directly, only 'regular' ones.
yes i know...this is why I use a wrapper in c++, but i cant use it. I dont know if its because you need a concrete .Net version, im using 4.5 (visual Studio 2012) or if im missing something
"e0434352" simply means ".NET exception", so it's impossible to give much help from the amount of information you have provide.
Three main possibilities:
- There is an untrapped exception inside the .NET code, e.g. a download is failing and you are allowing that exception to bubble up into the wrapper DLL and into MT4 rather than trapping it.
- The error means that the wrapper DLL cannot locate the .NET DLL.
- You almost certainly need to compile the .NET assembly as x86 rather than AnyCPU. Otherwise, on a 64-bit machine, you may well have 32-bit MT4 trying to use 64-bit .NET code.
Mql4 can not use c# DLLs directly, only 'regular' ones.
If the C# functions are not exported, then what you state is correct.
However, C# DLLs can be effectively turned into native DLLs by exporting the function calls. Then these exported DLLs may be directly referenced the same as 'regular' DLLs by MQL4. There is an article on the MQL5 site detailing exactly how to perform this export of C# DLL functions that also applies to MQL4:
https://www.mql5.com/en/articles/249
I haven't worked with the tutorial you reference. However there is a (fairly) easy method to export DLL functions from C# so that they may be imported with MQL4, the same as regular DLLs. This method makes use of a NuGet package "Unmanaged Exports (DllExport for .Net)" that does the necessary DLL function exports for you.
There is a fully functional demo on:
http://vb6-to-csharp.blogspot.com/2014/05/code-to-export-c-dll-to-metatrader.html
(Code to Export C# DLL to Metatrader Build 600+) that gives you both sides - the C# DLL export side and the MQL4 DLL import side.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use