Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1096

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
How do I create a pointer toa class method?
You need to create a pointer to a_int andint_ function.
In mql4 something is described about pointers and classes here(https://docs.mql4.com/ru/basis/types/this,https://docs.mql4.com/ru/basis/types/object_pointers,https://docs.mql4.com/ru/common/getpointer) but there are no comments, it's not clear what it's for and what it does. Without classes it's easy to declare a pointer using typedef but I want to understand how it works in classes.How do I create a pointer toa class method?
You need to create a pointer to a_int andint_ function.
In mql4 something is described about pointers and classes here(https://docs.mql4.com/ru/basis/types/this,https://docs.mql4.com/ru/basis/types/object_pointers,https://docs.mql4.com/ru/common/getpointer) but there are no comments, it's not clear what it's for and what it does. Without classes it's easy to declare a pointer using typedef, but I'd like to understand how it works in classes.You can't
https://www.mql5.com/ru/docs/basis/types/casting#dynamic_cast
https://www.mql5.com/ru/docs/basis/types/casting#dynamic_cast
Wrong. A person needs a pointer to a method of a class, not a cast to an inheritor.
there is no other - either procedural style without access control or OOP with access and type control
ok, never mind, the author always has highly specialised problems ;)
How do I create a pointer toa class method?
You need to create a pointer to a_int andint_ function.
In mql4 something is described about pointers and classes here(https://docs.mql4.com/ru/basis/types/this,https://docs.mql4.com/ru/basis/types/object_pointers,https://docs.mql4.com/ru/common/getpointer) but there's no comments, it's not clear what it's for and what it does. Without classes it's easy to declare a pointer using typedef, but I'd like to understand how it works in classes.Just wondering: how do you plan to use it?
Why do you need to save a pointer to the whole class, here's an examplehttps://docs.mql4.com/ru/basis/types/this
What to do with it afterwards?
You can't
The question arises: if you can't do that, why do you write functions in a class that take functions? And besides, sometimes you need to implement an interface and sometimes you don't know which function to call.
The question arises: if you can't do that, why do you write functions in a class that take functions? And besides, sometimes you need to implement an interface and sometimes you don't know which function to call.
How does this work?
How does it work?
A pointer to a function is passed as a parameter. I see no one has figured out how to do this with classes. It's also still not clear to me why a pointer to a class should be returned.
Here are interesting samples but they are not related to my question.
I have also seen something similar in the guide, but I have already closed these sites as my hands hurt and I have work to do.