Build 1583 and the referenced array bug

To add comments, please log in or register
Henrique Vilela
2010
Henrique Vilela  

Can't pass an array of scturcts as reference.

This bug was introduced in the build 1583:

int OnInit()
  {
   MqlParam params[4];

   Print("A ",ArraySize(params));

   Test(params);

   return(INIT_SUCCEEDED);
  }

void Test(MqlParam &params[])
  {
   Print("B ",ArraySize(params));
  }

void OnTick()
  {
  }

Result:

A 4
B 1

Replace MqlParam to MqlBookInfo and the reuslt is even weirder:

A 4
B 232317072

Change or a basic type (int, float, double, string...) and it works as supposed.

A 4
B 4

So... how to by pass this?

Henrique Vilela
2010
Henrique Vilela  

And this causes an Access Violation:

int OnInit()
  {
   MqlParam params[1];
   params[0].string_value="XXX";

   Test(params);

   return(INIT_SUCCEEDED);
  }

void Test(MqlParam &params[])
  {
   Print(params[0].string_value);
  }

void OnTick()
  {
  }

The error goes on, it's much bigger:


Alain Verleyen
36553
Alain Verleyen  
MT4/MT5 bugs have to be reported to ServiceDesk. Did it ?
Rafael Zimmermann
1153
Rafael Zimmermann  

Oi Vilela tudo bom?

Você chegou a receber algum feedback referente a este bug?

Estou recebendo ele também. 

To add comments, please log in or register