Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1004

 
Alexey Viktorov:

He won't understand. He is told to drop BEFORE... he understands as AFTER...

This is different: he sees the result of the SB guts. There's a query when creating a canvas about the existence of an object with that name. So it returns a response that it doesn't exist, and of course the object acknowledges it and works it out. And he reads GetLastError() in his code and sees the result of working of the CGraphic class - there was a request and there was an answer. But the person thinks that because the word Error is in the function, it means that it is the function that tells the programmer that there is an error somewhere in the code. He ignores the fact that it's only a service function that writes specific data into it. However, I've already explained to him that it's not very nice to build logic relying on the contents of _LastError, at least... Whether he understood it is another question.

 
Artyom Trishkin:

This is different: it sees the result of the SB guts. There is a request when creating a canvas that the object with this name exists. Therefore the response is returned that it doesn't exist, and of course the object acknowledges and everything works out. And he reads GetLastError() in his code and sees the result of working of the CGraphic class - there was a request and there was an answer. But the person thinks that because the word Error is in the function, it means that it's telling him that there is an error somewhere in the wilderness. He ignores the fact that it's only a service function that writes specific data into it. However, I've already explained to him that it's not very nice to build logic relying on the contents of _LastError, at least... Whether he understood it is another question.

Yes, I got it all. You amaze me today with your patience.

 
Alexey Viktorov:

I get it. You amaze me with your patience today.

I'm a darling today.

ZS. Not with a pout like you just started laughing, but with a soul.

 
Aleksey Vyazmikin:

I don't know how to work with kanvas - I'm struggling myself - I think the professionals will tell you now!

I don't understand. How do you bind a kanvas to a rectangle object? It should be moveable, the area is changeable along with the rectangle. Where is some example of how to do it?

 
leonerd:

I don't understand. How can a kanvas bind a rectangle to an object? It has to be moveable, the area is changeable along with this rectangle. Where is some example on how to do it?

Read here about coordinates. You create a triangle, look for the object and read its coordinates from the screen, create a canvas object and fill it by coordinates, if coordinates change, reload it. This is in theory - what doesn't work?

 
Aleksey Vyazmikin:

Read here about coordinates. Create a triangle, then look for an object and read the coordinates from the screen, create a canvas object, and fill according to the coordinates, if the coordinates have changed - reload it. This is in theory - what is not to be achieved?

wow... Should I get a change of object in OnChartEvent() and then get coordinates and update canvas? Eh... I thought it was simple.

 
leonerd:

wow... Should I use OnChartEvent() to catch the change of object, then get the coordinates and update the canvas? Eh... I thought it would be easy.

Look at this good example.

 
Aleksey Vyazmikin:

Look here for a good example.

Thanks, I'll have a look. Some extra class... A simple task to draw an object and fill it with a translucent background. Turned out to be so complicated.

All in all, it's horrible :D

 
Vitaly Muzichenko:

Then we need a code to read the file

After updating mt5 the problem has gone away, they worked quickly, thank you

 
Comments not related to this topic have been moved to "Questions from MQL4 MT4 MetaTrader 4 beginners".
Reason: