c++ - creating a basic dll in metatrader4 -
I am trying to create a basic Hello World DLL using codeblocks and metatrader4 and to do it in a striped version I am trying. My collection Dll and .def in the same dir as the .mq4 file.
file in test.mq4
#property Copyright "Copyright 2014, Metacott Software Corp." #property link "http://www.mql5.com" #property Version "1.00" #property Strict // # Import "gimmeDLL.dll" // string defined GetStringValue (string); // # import #import "gimmeDLL.dll" define string GetStringValue (string); #import Start Zero () {GetStringValue (); } In the main CPL of DLL
#define WIN32_LEAN_AND_MEAN // Skip rarely used content from Windows headers #include & lt; Windows.h & gt; # Include & lt; Stdlib.h & gt; # Include & lt; Stdio.h & gt; # Include & lt; Iostream & gt; using namespace std; # Defined MT4_EXPFUNC __declspec (dllexport) zero MT4_EXPFUNC GetStringValue () {cout & lt; & Lt; "Hello, world" & lt; & Lt; Endl; } I have gimmeDLL.def
library gimmeDLL export GetStringValue error
'defined' - semicolon expected market dump. Mq4 6 34 'define' - declared declaration without type of dump. Mq4 6 34 'GetStringValue' - wrong parameter marketDump.mq4 11 4
This is a script To compile as EA-dependency,
for a quick test, SARIPT in EA-wrapped-helloards, you A ) If there is a LOGGED-ON in EA-wrapped-helloards, there is a better way to target than EA, MQL4- "wrapper" + < + C) Being patient Strong> / Strong>, as long as the next FX-market event sends at least one stream spot event, to do so that your & lt ; localhost & gt; MT4 / Terminal Process your single-on-code ... Then, "how-to"? #import "gimmeDLL.dll" // MQL4- import-section-start-marker -------- string GetStringValue (); // Interface definition for compile time processing # Imports // MQL4-import-section-end-marker ---------- void OnInit () {// MQL4-on-init (), pre-build -578 Terminal, but use int init () () {...; Return (0); } & Lt; Code-constructor & gt; Comment ("DLL-call test", // MQL4-UI-printing feature "\ nA string is created == [[[" [", [GetStringValue (", "]]]"); }
Comments
Post a Comment