Function, return, MqlRates, access violation read to 0x00000000

 

With the last update (292 I guess), one of my functions stopped working.

First the function:

MqlRates getMqlRates(int index) {
   MqlRates rates[1];
   int r = CopyRates(NULL,0,index,1,rates);
   
   //printf("index=%d, r=%d, temp.high=%.4f",index,r,rates[0].high);
   return (rates[0]);
}

 and this function generates access violation read to 0x00000000 in "...\test.ex5"

After some hours, it all came down to the fact that returning MqlRates is not working anymore.

In this topic, more precisely Rosh's answer, Rosh says functions can return simple structures, where simple structure means (apparently) a structure without strings, objects, other structures, pointers, just normal types. 

And MqlRates is a simple structure if I didn't omit something.

Why functions cannot return MqlRates anymore? Is it bug or feature? 

 

Thanks for your message. It will be fixed at next build. Please wait a bit.
 
Rosh:

Thanks for your message. It will be fixed at next build. Please wait a bit.

no hurry.

It's good I found another bug

Get in touch with developers using Service Desk!
  • www.mql5.com
We therefore attach great importance to all user reports about issues in our programs and try to answer each one of them.