Download MetaTrader 5

Build 257, Access violation read in visitting const string in a dual const struct array

To add comments, please log in or register
Loong
1285
Loong  
  Print("VisitIndiParam{for}, rcaIndiParam.aIndiParam[i].string_value="+rcaIndiParam.aIndiParam[i].string_value);

This code work well before Build 252, but cause "Access violation read" in Build 256 and 257.
(I did not test Build 253, 254 and 255.)
You can visit a const array of MqlParam,
but if you put the const array of MqlParam into a const struct as a member,
and visit the const array from the const struct,
you will get a "Access violation read" error when you visitting the string_value member.
This error is always occurred in visitting the THIRD member of the array of MqlParam.
But It get wrong value in visitting the SECOND member of the array of MqlParam.
When I test other const struct array, this error will occur, but may be in visitting the SECOND member.
It is always right in visitting the FIRST member of the const struct array. 

Documentation on MQL5: Standard Constants, Enumerations and Structures / Data Structures / Structure of Input Parameters
  • www.mql5.com
Standard Constants, Enumerations and Structures / Data Structures / Structure of Input Parameters - Documentation on MQL5
Files:
Loong
1285
Loong  

some print

2010.03.22 11:10:40     CopyParam (GBPUSD,D1)   Access violation read to 0x00000023 in 'D:\MT5\MQL5\Indicators\CopyParam.ex5'
2010.03.22 11:10:40     CopyParam (GBPUSD,D1)   VisitIndiParam{for}, rcaIndiParam.aIndiParam[i].double_value=0.00000000
2010.03.22 11:10:40     CopyParam (GBPUSD,D1)   VisitIndiParam{for}, rcaIndiParam.aIndiParam[i].integer_value=8
2010.03.22 11:10:40     CopyParam (GBPUSD,D1)   VisitIndiParam{for}, rcaIndiParam.aIndiParam[i].type=7
2010.03.22 11:10:40     CopyParam (GBPUSD,D1)   VisitIndiParam{for}, i=2
2010.03.22 11:10:40     CopyParam (GBPUSD,D1)   VisitIndiParam{for}, rcaIndiParam.aIndiParam[i].string_value=?aram[i
2010.03.22 11:10:40     CopyParam (GBPUSD,D1)   VisitIndiParam{for}, rcaIndiParam.aIndiParam[i].double_value=0.00000000
2010.03.22 11:10:40     CopyParam (GBPUSD,D1)   VisitIndiParam{for}, rcaIndiParam.aIndiParam[i].integer_value=8
2010.03.22 11:10:40     CopyParam (GBPUSD,D1)   VisitIndiParam{for}, rcaIndiParam.aIndiParam[i].type=7
2010.03.22 11:10:40     CopyParam (GBPUSD,D1)   VisitIndiParam{for}, i=1
2010.03.22 11:10:40     CopyParam (GBPUSD,D1)   VisitIndiParam{for}, rcaIndiParam.aIndiParam[i].string_value=0
2010.03.22 11:10:40     CopyParam (GBPUSD,D1)   VisitIndiParam{for}, rcaIndiParam.aIndiParam[i].double_value=00.00000000
2010.03.22 11:10:40     CopyParam (GBPUSD,D1)   VisitIndiParam{for}, rcaIndiParam.aIndiParam[i].integer_value=13
2010.03.22 11:10:40     CopyParam (GBPUSD,D1)   VisitIndiParam{for}, rcaIndiParam.aIndiParam[i].type=7
2010.03.22 11:10:40     CopyParam (GBPUSD,D1)   VisitIndiParam{for}, i=0
2010.03.22 11:10:40     CopyParam (GBPUSD,D1)   VisitIndiParam{before for}, iNum=8
2010.03.22 11:10:40     CopyParam (GBPUSD,D1)   VisitIndiParam
2010.03.22 11:10:40     CopyParam (GBPUSD,D1)   VisitMqlParam{before return}
2010.03.22 11:10:40     CopyParam (GBPUSD,D1)   VisitMqlParam{before for}, iNum=8
2010.03.22 11:10:40     CopyParam (GBPUSD,D1)   VisitMqlParam

 

Alexey Da
Moderator
6586
Alexey Da  

Thank you for your message.

We will check it. 

Ilyas
1201
Ilyas  

Fixed. Please wait for updates.

To add comments, please log in or register