tunage:I am trying to create a basic hello world dll using codeblocks #import "gimmeDLL.dll" | Importing Function (#import) - MQL4 Documentation #import "file_name" |
I am not making an indicator. I am making an actual driver.
I used "hello world" in a dll file for a reason. I just need 'hello world' to start.
No where in that doc does it address the core communication of mt4 (the start button specifically) and a dll file.
tunage:No where in that doc does it address the core communication of mt4 (the start button specifically) and a dll file. | MQL4\Scripts\Examples\DLL |
tunage:No where in that doc does it address the core communication of mt4 (the start button specifically) and a dll file. | MQL4\Scripts\Examples\DLL |
That got me really close, but I am still missing something really foolish :(
in file test.mq4
#property copyright "Copyright 2014, MetaQuotes Software Corp." #property link "https://www.mql5.com" #property version "1.00" #property strict #import "gimmeDLL.dll" string GetStringValue(string) define; #import void OnStart() { GetStringValue(); }
in the main.cpp of the dll
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers #include <windows.h> #include <stdlib.h> #include <stdio.h> #include <iostream> using namespace std; #define MT4_EXPFUNC __declspec(dllexport) void MT4_EXPFUNC GetStringValue() { cout << "Hello, World" << endl; }
in gimmeDLL.def I have
LIBRARY gimmeDLL EXPORTS GetStringValue
error
'define' - semicolon expected marketDump.mq4 6 34 'define' - declaration without type marketDump.mq4 6 34
'GetStringValue' - wrong parameters count marketDump.mq4 11 4
tunage: That got me really close, but I am still missing something really foolish :( | string GetStringValue(string) define; : void MT4_EXPFUNC GetStringValue()
|
tunage: That got me really close, but I am still missing something really foolish :( |
|
I apologize, I should of mentioned I get the same error with string GetStringValue(string) define; or string GetStringValue() define;
I have been mix matching every which way to try and figure out what semicolon it's talking about. It's driving me nutz.
It takes nothing, just print Hello World.
I took the sample dll and chopped and forgot to leave out the string in the post. But same error either way.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I am trying to create a basic hello world dll using codeblocks and metatrader4 and trying to do it in a striped version. my compile .dll and .def are in the same dir as the .mq4 file.
in file test.mq4
in the main.cpp of the dll
error