Download MetaTrader 5
To add comments, please log in or register
MQL5 library has more than 1500 apps already. Contribute your own one!
chinaski
836
chinaski 2016.01.21 17:57 

Hello,

compiler: 

i newly have problems with compiler of build 1241.

There is one expert which keeps the compiler crashing.

I could find the row which - when outcommented - removes the crash but i could not reproduce

this issues with simple code. 


runtime: 

Also, i have strange behaviour in windows 10 at runtime: A pointer cast to base class pointer fails which seems to be the case only on windows 10 machines.

So the pointer is invalid. In this case as well, i could not create simple code to demonstrate it.

 

example: 

 

classA* pA=(classA*) this;

 This worked so far on my MT5 installed in windows 7.

I works as well in debug mode in Windows 10 but in release note.

I already wrote the desk but i like to know, if i am the only one having these problems.

 

Thank you 

asdad 

chinaski
836
chinaski 2016.01.21 18:14  

I could reproduce the cast problem:

The expert attached, shows a message box about invalid pointer when you run it in windows 10 release (so no debug session).

Files:
ea_cast.mq5 1 kb
Alain Verleyen
Moderator
29466
Alain Verleyen 2016.01.21 18:25  
chinaski:

I could reproduce the cast problem:

The expert attached, shows a message box about invalid pointer when you run it in windows 10 release (so no debug session).

Confirmed. Is it reported to ServiceDesk ?
Ovo Cz
2987
Ovo Cz 2016.01.21 18:43  
chinaski:

I could reproduce the cast problem:

The expert attached, shows a message box about invalid pointer when you run it in windows 10 release (so no debug session).

Interesting, I did not even know this could be implicitly converted to a pointer, in my code I used GetPointer(this) in assignments. But it was MT4.

chinaski
836
chinaski 2016.01.21 22:11  
I sent the sample to the service desk
chinaski
836
chinaski 2016.01.21 22:16  

Changing code from

(type*) this 

to

(type*) GetPointer(this)

 

solves it. Thank you for this hint. However, i never used GetPointer and my expert were fine. 

Ovo Cz
2987
Ovo Cz 2016.01.21 22:27  
chinaski:

Changing code from

(type*) this 

to

(type*) GetPointer(this)

 

solves it. Thank you for this hint. However, i never used GetPointer and my expert were fine. 

There is additional unusual implicit behaviour - you may skip the casting operator (type*) in assignments, i.e. classA* pA= GetPointer(this);

Once they fix it I would get zillion errors. 

chinaski
836
chinaski 2016.01.22 10:38  

Hello,

thank you, the GetPointer solved all problems.

The invalid cast does not occur any longer as well as compiler crash disappeared.

 

I had this problems only on windows 10 in release version.

Thank you for help. 

/
To add comments, please log in or register