lippmaje:
Hi, I can only guess. I think it's because of managed code. There should be an option to build the Dll in native mode.
And did you check out the sample Dll project in MQL4 - Scripts - Examples - DLL folder?
Hey Thank you for your answer.
I checked the code out. It is C++
I try to build a WinForms on MT4 with C#.
Chris E.:
Yes I export them. But it doesn't work and I do not know why.
No idea. I suggest to change the title to 'How to write a C# dll...' so it points out the problem. :/ And it's the same for MT5.
Yes I export them. But it doesn't work and I do not know why.
lippmaje:
No idea. I suggest to change the title to 'How to write a C# dll...' so it points out the problem. :/ And it's the same for MT5.
No idea. I suggest to change the title to 'How to write a C# dll...' so it points out the problem. :/ And it's the same for MT5.
[DllExport("addme", CallingConvention = CallingConvention.StdCall)] [return: MarshalAs(UnmanagedType.I4)] public static int addme([MarshalAs(UnmanagedType.I4)] int a, [MarshalAs(UnmanagedType.I4)] int b) { return a + b; }
Got the solution.
I am using "using RGiesecke.DllExport;"
Yeah, that's what I meant with "it doesn't seem so." Anyways you tackled it, nice.
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
Hello everyone,
I do not know how to write a dll for mt4?
When I write a DLL in C# and export it for 32bit or 64bit it do not work.
C# Code:
MT4 CODE: (at this one Expert-Advisor crashes -> It removes the EA from chart)
another code to try: (This one the EA doesn't crash, but it do nothing. Do not even anything, when I place an Alert signal before)
Can someone help me please?