MT5 [build 4410]: Bug in CCanvas::Create() method causing error code 5035 to be set.

 

I have a piece of code that calls into the canvas CreateBitmapLabel() method...

#include <Canvas/Canvas.mqh>

CCanvas canvas;
canvas.CreateBitmapLabel("test_name", 0, 0, width, height, clrfmt);

This in turn makes its way down to the Create() method...

bool CCanvas::Create(const string name,const int width,const int height,ENUM_COLOR_FORMAT clrfmt)

...where the error code 5035 is being set in the following line...

m_rcname="::" + StringSubstr(name,0,63-uniq.Length())+uniq;

As a test, I created a small piece of code to highlight the issue...

int OnInit()
{
        string name = "abcdef";
        string uniq=(string)ChartID()+(string)GetTickCount()+"."+(string)(GetMicrosecondCount()&0x3FF);
        Print("Last Error: ", GetLastError());
        string m_rcname="::" + StringSubstr(name,0,63-uniq.Length())+uniq;
        Print("Last Error: ", GetLastError());
}
 
So what ? That's not a bug.
 
Alain Verleyen #:
So what ? That's not a bug.

Thanks. That's really helpful.

 
metaRaider #:

Thanks. That's really helpful.

You are welcome.