You need to run Timer4 method (highlighted in blue) of CTestTimer class
Didn't get into it.
#property indicator_chart_window#include <Timer.mqh> // https://www.mql5.com/ru/code/31306//+------------------------------------------------------------------+class CTestTimer {
private:
//typedef void (CTestTimer::*TFunc2)(); // так работает в C++, но здесь не работаетpublic:
staticint x4;
CTestTimer() {
//TFunc2 p=CTestTimer::Timer4;//TFunc2 p=Timer4;//timers.NewTimer(700,p);
timers.NewTimer(700,Method2Function); // ошибка 'Timer4' - pointer to this function type is not supported yet
};
~CTestTimer(){};
staticvoid Timer4() {
x4++;
if (x4==7) timers.KillTimer(Method2Function); // удаляем этот таймер
}
};
//+------------------------------------------------------------------+staticint CTestTimer::x4 = 0;
void Method2Function()
{
CTestTimer::Timer4();
}
Thanks for your time. But I wrote above that the method should be non-static. It's clear that this is possible with static methods. A static method is not OOP at all. Obviously I wanted too much, or rather impossible. I was confused by the fact that it was possible to do so in C++, but on examining it, I understood that such a pointer has a totally different structure,
A non-static class method has a single implementation, which sits somewhere in memory and affects all objects of the class. But every object has its own unique current state of internal variables, so such a pointer to a non-static method must also have a filled in parameter structure of the object it's applied to at the moment. Apologies to all for wasting time. We need to look for other ways to generally control objects of different classes.
TheXpert: Why bang your head against the wall when there's a door next to it? The multitimer task with a handler call to an external class has been solved.
It wasn't about the timer. I was just daydreaming and stupid.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
You need to run Timer4 method (highlighted in blue) of CTestTimer class
Didn't get into it.
Forum on trading, automated trading systems and trading strategies testing
Peculiarities of mql5, tips and tricks
fxsaber, 2020.05.14 02:57
I got it again. I assume that this may occur in rare situations when re-logging.
The solution is, if false, to retry after a short pause.
This is a bad solution. Here is a much better solution.
If you do a manual re-login, this EA will still work. Without the highlighted string, it will self-delete.
Didn't get into it.
Thanks for your time. But I wrote above that the method should be non-static. It's clear that this is possible with static methods. A static method is not OOP at all.
Obviously I wanted too much, or rather impossible.
I was confused by the fact that it was possible to do so in C++, but on examining it, I understood that such a pointer has a totally different structure,
https://habr.com/ru/post/333334/
And it's understandable.
A non-static class method has a single implementation, which sits somewhere in memory and affects all objects of the class.
But every object has its own unique current state of internal variables, so such a pointer to a non-static method must also have a filled in parameter structure of the object it's applied to at the moment.
Apologies to all for wasting time.
We need to look for other ways to generally control objects of different classes.
Proof of no solution is also a solution.
Thanks for your time. But I wrote above that the method should be non-static. It's clear that this is possible with static.
You were given two examples above. one with full implementation
You don't seem to have understood my problem.
It has no solution.
You don't seem to have understood my problem.
It has no solution.
Why bang your head against the wall when there's a door next to it? The multitimer problem with a handler call to an external class has been solved.
This fellow here has a solution to your problem as you see it, non-public though.
Why bang your head against the wall when there's a door next to it? The multitimer task with a handler call to an external class has been solved.
It wasn't about the timer.
I was just daydreaming and stupid.
I was just daydreaming and dumbfounded.
I'm all for a full-fledged typedef or the same binds in mql, but that's about it.
Is it possible to distinguish a manually created graphical object from an object created by an indicator or EA?
In the function
Is it possible to distinguish a manually created graphical object from an object created by an indicator or EA?
In the function
You can do it with the left mouse button control.
For example like this: