Download MetaTrader 5
To add comments, please log in or register
Manage agents in your profile. It is easy!
Carl Schreiber
5930
Carl Schreiber 2014.03.29 09:08 
The old builts didn't enable us to get the Windows Errors: GetLastError()?

Now the mt4 still has that name :(

Gooly

Alain Verleyen
Moderator
28518
Alain Verleyen 2014.03.29 09:32  
gooly:
The old builts didn't enable us to get the Windows Errors: GetLastError()?

Now the mt4 still has that name :(

Gooly

https://www.mql5.com/en/forum/149364

See also documentation for scope resolution.

Carl Schreiber
5930
Carl Schreiber 2014.03.29 09:57  

hmm, I tried that now, but immediately I get this compiler error due the the use of the mt4's b625 own GetLastError():


'GetLastError' - ambiguous call to overloaded function with the same parameters myEA.mq4        384     48

//This is the Line:

Print ("read 1: File ",fnName," not found ", GetLastError());
Carl Schreiber
5930
Carl Schreiber 2014.03.29 10:46  

ok I found the problem:

ALL

GetLastError() // mt4

has to be replaced by

::GetLastError() // mt4

sigh

Alain Verleyen
Moderator
28518
Alain Verleyen 2014.03.29 10:52  
gooly:

ok I found the problem:

ALL

has to be replaced by

sigh

Isn't exactly what the links I posted are saying ?
Carl Schreiber
5930
Carl Schreiber 2014.03.29 12:32  
angevoyageur:
Isn't exactly what the links I posted are saying ?

Yes, but it is not what I expected so I didn't look carefully!

I would expect an intelligent compiler to be able to distinguish itself between its own function:

GetLastError()

and the Windows function which always has to be called by

kernel32::GetLastError()

Obviously the programmers didn't think of their users.

Gooly

/
To add comments, please log in or register