Windows Error Messages - can I get them now - how?

 
The old builts didn't enable us to get the Windows Errors: GetLastError()?

Now the mt4 still has that name :(

Gooly

 
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.

 

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());
 

ok I found the problem:

ALL

GetLastError() // mt4

has to be replaced by

::GetLastError() // mt4

sigh

 
gooly:

ok I found the problem:

ALL

has to be replaced by

sigh

Isn't exactly what the links I posted are saying ?
 
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

Reason: