Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1002

 
Artyom Trishkin:

Well, since you reset the last error, look in the wilds of CGraphic where this error code occurs.

This is the competence of the developers, or professionals.

 
Aleksey Vyazmikin:

This is the competence of the developers, or professionals.

I replied in that thread. It is not their competence, it is your interest:

Forum on trading, automated trading systems and testing trading strategies

Testing CGraphic - questions and comments

Artyom Trishkin, 2019.02.17 07:53

Where have you been told that there is an error there? I told you - look for a point in the library where it can be written to the _LastError variable. It's not necessarily that the code with the error has worked. Because it might search for an object (and if it is absent, the error code will be written into the variable) and create it. But if object won't be created, then it's an error, but it will be created and everything will work out. But after checking, the error code (the object was absent before creation) will be written into a variable, which you then read in your code.


 
I need to create a rectangle filled with a semi-transparent background. From what I understand, I need to use CCanvas. But I need to be able to modify the rectangle with the mouse on the graphic (move its borders). Which property should I use? Is there any example?
 
Artyom Trishkin:

Answered in that thread. It is not their competence, it is your interest:


What is my interest, please explain.

 
leonerd:
I need to create a rectangle filled with a semi-transparent background. As I understand it, I need to use CCanvas. But I need to be able to change the rectangle with mouse on the graphic (move its borders). Which property should I use? Is there any example?

Have you tried creating a triangle object without a fill and filling it with a canvas, or is something there not possible? Just an idea.

 
Aleksey Vyazmikin:

Have you tried creating a triangle object without a fill and filling it with a canvas, or is something there not possible? Just an idea.

I don't know, probably possible. But how do you fill a triangle with a canvas? Can you tell me how to do that, please?

 
leonerd:

I don't know, it's probably possible. How do you fill in the triangle with a canvas? Can you give me a hint, please?

I don't know how to work with canvas - I'm struggling with it myself - I think professionals will tell me!

 
Denis Nikolaev:
Hello, my alert function reads a string from a file and outputs it in either Chinese or Japanese characters, how do I fix it?

Try adding a string, it might help

int OnInit()
 {
  MQLSetInteger(MQL_CODEPAGE,CP_ACP);
  ....

 }
 
Aleksey Vyazmikin:

What is my interest, please explain.

Forum on trading, automated trading systems and strategy testing

Testing CGraphic - questions and comments

Artyom Trishkin, 2019.02.17 09:08

There is no mistake there, read it again:

So - it's only your interest to know why you are reading the error after the normal code execution. You most likely don't understand that having code other than zero in the _LastError variable does not necessarily mean there is an error in the CGraphic code, and not only in it. In this case, it could be a simple result of searching for the existence of an object, which was executed inside the CGraphic in SB. There was a request for an object by name, the result returned -1 and code 4202 was written into _LastError. Then the object was created, everything worked and was returned to the calling program. And there you immediately read the error code and get it. But there is no error - you see the result of queries inside the SB.

I am only suggesting a possible reason for what you are reporting.

So, if you really want to find a real error and report it, you need to go through the whole CGraphic code in the debugger and catch the real error that will lead to logic and performance failures, rather than just claiming that you read the error code and therefore - it is definitely there.


 
Artyom Trishkin:

Answered you there as well, and there is no interest in what I have described - not justified.

Reason: