I have a program where I check TerminalInfoInteger to get keystates of buttons in Timer. However, sometimes when I remove the EA, seems that if I catch them in mid-execution they get stuck and cause abnormal termination. Is it a mt5 bug? Or is there a way to solve it? How should I report it?
This is the "minimum" code to cause the error (the program where I use it is quite bigger but the effect is the same):
After some tries running the EA and removing it, an abnormal termination would happen. Notice how it happens inside the function, since not all prints are logged. They also seem to get way slower if you check the logging times
Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
Only seems to happen with keystate checks (other terminalinfointegers run faster). By what I saw in the profiler when searching for the bug, that function seemed already to be quite costly, but not so much to take more than half a second per call. Something internally seems to interfere when removing the EA... some looped check that triggers when the removal flag is set, a change in process priority, or who knows
Coincidentally, I already found another bug recently (which I reported to service desk too but still with no answer) in a function that also makes use of winuser.h (according to the documentation, TerminalInfoInteger for keystates calls GetKeyState and TranslateKey calls ToUnicodeEx). Maybe it's just a coincidence, or microsoft changed something about that file, or whoever was tasked with making winuser functions for metatrader whenever they were implemented didn't use them well and nobody noticed for years
- www.mql5.com
- 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 have a program where I check TerminalInfoInteger to get keystates of buttons in Timer. However, sometimes when I remove the EA, seems that if I catch them in mid-execution they get stuck and cause abnormal termination. Is it a mt5 bug? Or is there a way to solve it? How should I report it?
This is the "minimum" code to cause the error (the program where I use it is quite bigger but the effect is the same):
After some tries running the EA and removing it, an abnormal termination would happen. Notice how it happens inside the function, since not all prints are logged. They also seem to get way slower if you check the logging times