How to call a function from a DLL file from [ MQL5 ] code?


Why the first
MessageBox() works and the second
doesn't?



I don't know where the problem is.



Does the MQL5 can access the
dll file?



I need to to call C# functions that read
JSON.



No errors appear in MetaEditor.



C# .dll file:



using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.InteropServices;
namespace TestMe
{
class Test
{

// [DllExport("Add", CallingConvention =
CallingConvention.StdCall)]
public static int Add(int left, int right)
{
return left + right;
}


public static int Sub(int left, int right)
{
return left - right;
}


public static double AddDouble(double left, double right)
{
return left + right;
}


public static float AddFloat(float left, float right)
{
return left + right;
}
}
}


this is an MQL5 code:



#import "TestMe.dll"
int Add( int left, int right );
int Sub( int left, int right );
float AddFloat( float left, float right );
double AddDouble( double left, double right );
#import

#property strict // MQL-syntax-mode-modifier ==
"strict"

int OnInit()
{ int k = 0;
MessageBox( k ); // this call works
k = Add( 1, 666 );
MessageBox( k ); // Doesn't work

return( INIT_SUCCEEDED );
}

- Technology - Languages
+ Webmasters
+ Development
+ Development Tools
+ Internet
+ Mobile Programming
+ Linux
+ Unix
+ Apple
+ Ubuntu
+ Mobile & Tablets
+ Databases
+ Android
+ Network & Servers
+ Operating Systems
+ Coding
+ Design Software
+ Web Development
+ Game Development
+ Access
+ Excel
+ Web Design
+ Web Hosting
+ Web Site Reviews
+ Domain Name
+ Information Security
+ Software
+ Computers
+ Electronics
+ Hardware
+ Windows
+ PHP
+ ASP/ASP.Net
+ C/C++/C#
+ VB/VB.Net
+ JAVA
+ Javascript
+ Programming
Privacy Policy - Copyrights Notice - Feedback - Report Violation 2018 © BigHow