Hi,
I have a problem, if you could help me. The problem is that I’m trying to implement my DLL function in MQL script, but it doesn’t work. The example is very simple.
VS2010 C++ code
MQL code
The problem is that the script always stops working at the moment, when I’m calling the dll function.
Please, tell me where I’m wrong .
Thank you in advance.
I have a problem, if you could help me. The problem is that I’m trying to implement my DLL function in MQL script, but it doesn’t work. The example is very simple.
VS2010 C++ code
Inserted Code
[color=#0000ff]#include[/color][font=Courier New][size=2][color=#a31515][font=Courier New][size=2][color=#a31515][font=Courier New][size=2][color=#a31515]"stdafx.h"[/color][/size][/font]
[/color][/size][/font][/color][/size][/font][font=Courier New][size=2][color=#0000ff][font=Courier New][size=2][color=#0000ff][font=Courier New][size=2][color=#0000ff]__declspec[/color][/size][/font][/color][/size][/font][/color][/size][/font][font=Courier New][size=2][font=Courier New][size=2]([/size][/font][/size][/font][font=Courier New][size=2][color=#0000ff][font=Courier New][size=2][color=#0000ff][font=Courier New][size=2][color=#0000ff]dllexport[/color][/size][/font][/color][/size][/font][/color][/size][/font][font=Courier New][size=2][font=Courier New][size=2]) [/size][/font][/size][/font][font=Courier New][size=2][color=#0000ff][font=Courier New][size=2][color=#0000ff][font=Courier New][size=2][color=#0000ff]double[/color][/size][/font][/color][/size][/font][/color][/size][/font][font=Courier New][size=2][color=#0000ff][font=Courier New][size=2][color=#0000ff][font=Courier New][size=2][color=#0000ff]__stdcall[/color][/size][/font][/color][/size][/font][/color][/size][/font][font=Courier New][size=2][font=Courier New][size=2] BoxVolume([/size][/font][/size][/font][font=Courier New][size=2][color=#0000ff][font=Courier New][size=2][color=#0000ff][font=Courier New][size=2][color=#0000ff]double[/color][/size][/font][/color][/size][/font][/color][/size][/font][font=Courier New][size=2][font=Courier New][size=2] L, [/size][/font][/size][/font][font=Courier New][size=2][color=#0000ff][font=Courier New][size=2][color=#0000ff][font=Courier New][size=2][color=#0000ff]double[/color][/size][/font][/color][/size][/font][/color][/size][/font][font=Courier New][size=2][font=Courier New][size=2] H, [/size][/font][/size][/font][font=Courier New][size=2][color=#0000ff][font=Courier New][size=2][color=#0000ff][font=Courier New][size=2][color=#0000ff]double[/color][/size][/font][/color][/size][/font][/color][/size][/font][font=Courier New][size=2][font=Courier New][size=2] W)[/size][/font]
[size=2][font=Courier New]{[/font][/size]
[/size][/font][font=Courier New][size=2][color=#0000ff][font=Courier New][size=2][color=#0000ff][font=Courier New][size=2][color=#0000ff]return[/color][/size][/font][/color][/size][/font][/color][/size][/font][font=Courier New][size=2][font=Courier New][size=2] ( L * H * W );[/size][/font]
[size=2][font=Courier New]}[/font][/size]
[/size][/font] MQL code
Inserted Code
#import "user32.dll"
int MessageBoxA(int hWnd, string lpText, string lpCaption, int uType);
#import "TestDLL.dll"
double BoxVolume(double L, double H, double W);
#import
int start()
{
int uType,hWnd;
MessageBoxA(hWnd, "Click OK to begin", "Click OK to begin", uType);
Alert("Test Begin");
Alert("Test Result: ", BoxVolume(1,2,3));
Alert("Test End");
return(0);
} Please, tell me where I’m wrong .
Thank you in advance.