Discussion of article "Graphical Interfaces XI: Integrating the Standard Graphics Library (build 16)" - page 8
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
I tried to change the ElementBase.mqh file, it scolds even more.
I tried to change the ElementBase.mqh file, it scolds even more.
Both ElementBase.mqh and Element.mqh need to be changed.
In recent builds, we have added a message to the compiler for those cases where an ancestor method is overloaded in a descendant:
Example
In this case, the ancestor SFoo's func(int) function is called in the descendant class SBar because the compiler did not find it in the descendant. The descendant has only func(double) function and the compiler tries to find a function with a suitable parameter in the inheritance tree.
That is, the MQL5 compiler performs overloading instead of overriding the method in the descendant. At the beginning of the language development, this relaxation of the MQL5 compiler was not considered critical. But it may be changed in the future, so now an explicit warning is issued to developers of MQL5 programmes to take into account and correct their codes.
Strictly speaking, overriding is a bit broader concept, you can search the difference between overloading and overriding on the Internet
.
1. Is it correct that such code is not compiled?
2. Is it correct that this code, in addition to the above-mentioned error, generates the warning "deprecated behaviour, hidden method calling will be disabled in a future MQL compiler version TestCompiler.mq5 27 18"?
1. Is it correct that such code is not compiled?
2. Is it correct that this code, in addition to the above error, generates the warning "deprecated behaviour, hidden method calling will be disabled in a future MQL compiler version TestCompiler.mq5 27 18"?
Maybe it's better to ask this in the thread about the new version of the terminal? ) I think they will answer faster there )
The warning seems to fit into the new logic of the compiler, but I don't understand about private member, it's still public...
Both ElementBase.mqh and Element.mqh need to be changed
In ElementBase.mqh it's clear, you replaced "Is" with "Set" (but it's not clear why we can do that).
but in Element.mqh there is another line
In ElementBase.mqh it's clear, you replaced "Is" with "Set" (but it's not clear why we can do that)
but in Element.mqh there is another line
Well now MQ doesn't like the same names (variables, methods, etc) :)
We just changed the name of the method (and why not? ) ) )
We don't want to change anything - we wait for the author to redo everything ) )
The author is probably "finished" with this project, can you specify in which lines what to write so that the compiler does not swear, and better of course orthodox (corrected) files ( ElementBase.mqh and in Element.mqh) for the people
1. I'm in the middle of another project right now.
2. I have very much changed the library )
Well, besides changes in ElementBase.mqh and Element.mqh you should go through all the elements, maybe there are these methods there too.
Maybe it's better to ask in the thread about the new version of the terminal? ) I think they will answer faster there )
The warning seems to fit into the new logic of the compiler, but I don't understand about private member, it's still public...
I found a workaround there:
Forum on trading, automated trading systems and testing trading strategies
New version of MetaTrader 4 build 1170
fxsaber, 2019.09.06 09:39 pm.
I believe that the proposed option in MT5 is an innovation that should be added to MT4 as well.
But if you write the code in the old-fashioned way, it will work everywhere.
This is how my example works:
CC(void) { ((CA)m_b).func(); }But this is not a solution, of course.
@Ilyas, no option without conversion to CA?