when dll return false,
after arrive to ex4 the value become true
which is horrible ~~
i use below code in DLL
bool __stdcall Do_trade_time_DLL(int hour,double GMT8_subtract_brokerT,int day_ofweek, int day_ofweek_HK, double fluctuate_level)
{ return(false) }
and i print the value in ex4 directly, which after the line gone to DLL, but the result is 1..-->horrible~~
please amend it, stringo, thanks
yes, i also find out this problem in my project ~~
bool __stdcall Do_trade_time_DLL(int hour,double GMT8_subtract_brokerT,int day_ofweek, int day_ofweek_HK, double fluctuate_level)
Not an MQL bug. A bool in C++ is 1 byte (it doesn't exist in C). A bool in MQL is 4 bytes (or perhaps 2). In effect, you're trying to return a single byte of return value back to a caller who's expecting 4 (or 2) bytes.
Try changing the function declaration to either of the following (which are effectively identical because the WinSDK does "typedef int BOOL"):
BOOL __stdcall Do_trade_time_DLL(int hour,double GMT8_subtract_brokerT,int day_ofweek, int day_ofweek_HK, double fluctuate_level)
int __stdcall Do_trade_time_DLL(int hour,double GMT8_subtract_brokerT,int day_ofweek, int day_ofweek_HK, double fluctuate_level)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
when dll return false,
after arrive to ex4 the value become true
which is horrible ~~
i use below code in DLL
bool __stdcall Do_trade_time_DLL(int hour,double GMT8_subtract_brokerT,int day_ofweek, int day_ofweek_HK, double fluctuate_level)
{ return(false) }
and i print the value in ex4 directly, which after the line gone to DLL, but the result is 1..-->horrible~~
please amend it, stringo, thanks