MQL_DLLS_ALLOWED cannot be set
MQL_DLLS_ALLOWED cannot be set
Loading saved threads...
Jaffer Wilson · External communityPost link
External question — Stack Overflow Stack Exchange
Author: Jaffer Wilson
Original post: https://stackoverflow.com/questions/58437141
License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/
Adaptation: HTML converted to plain text; contact email addresses removed.
I want to know if there is any way to set the property id values of the
ENUM_MQL_INFO_INTEGER
using external program or dll or anything.
I tried this:
int OnInit()
{
//---
MQL_DLLS_ALLOWED = 1;
Print(MQLInfoInteger(MQL_DLLS_ALLOWED));
//---
return(INIT_SUCCEEDED);
}
It gave error:
'MQL_DLLS_ALLOWED' - l-value required TestingEnum.mq5 15 4
'1' - cannot convert enum TestingEnum.mq5 15 22
'=' - l-value required TestingEnum.mq5 15 21
Kindly, let me know what I can do.
Quote
Report
Daniel Kniaz · External communityPost link
External answer — Stack Overflow Stack Exchange
Author: Daniel Kniaz
Original post: https://stackoverflow.com/a/58474061
License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/
Adaptation: HTML converted to plain text; contact email addresses removed.
I cannot help you with your question directly, mainly because of the reasons discussed in the comments. I believe you can check the value whether DLL is allowed, but you cannot enable/disable it easily. Maybe there is a way with running MT terminal from the command line, with some keys allowing or blocking dll, so you may check. But that means restarting your platform, I am not sure that is convenient.
If I were you, and tired of enabling/disabling dll dozen times, I would introduce a global variable of client terminal, with values 0 or 1 (doubles of course). Then, if it is zero, dlls are not called, and ea does not start (if you check that in
OnInit()
), if it is non-zero value, dll works. A simple script changing this GV can be written and hot keys assigned. In that case, hotkey blocks everything, and allows dll again when needed.
In case you need any help with that - I will edit my code and provide some basic examples.
Quote
Report
Xenon_Blue · External communityPost link
External answer — Stack Overflow Stack Exchange
Author: Xenon_Blue
Original post: https://stackoverflow.com/a/79864541
License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/
Adaptation: HTML converted to plain text; contact email addresses removed.
You cannot set this value using -
MQL_DLLS_ALLOWED = 1;
The MQLInfoInteger is the function that will return a value indicating the property of the currently running program or the state of the terminal, or server etc. Basically, the state of the trading environment.
To allow .DLLs, go to the Metatrader terminal > Tools > Options > Expert Advisors and tick the box 'Allow DLL imports'.
Then you can MQLInfoInteger function as a conditional in your functions.
Quote
Report
Post Reply
Quoted from Forex.com.bd-Editorial External question — Stack Overflow Stack Exchange Author: Jaffer Wilson Source score (net votes, not local likes): 0 Original post: https://stackoverflow.com/questions/58437141 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. I want to know if there is any way to set the property id values of the ENUM_MQL_INFO_INTEGER using external program or dll or anything. I tried this: int OnInit() { //--- MQL_DLLS_ALLOWED = 1; Print(MQLInfoInteger(MQL_DLLS_ALLOWED)); //--- return(INIT_SUCCEEDED); } It gave error: 'MQL_DLLS_ALLOWED' - l-value required TestingEnum.mq5 15 4 '1' - cannot convert enum TestingEnum.mq5 15 22 '=' - l-value required TestingEnum.mq5 15 21 Kindly, let me know what I can do.
Checking account access…