While testing and attempting to open an unexisting file, experts log yields correct message "invalid handle -1 in FileSize" but GetLastError() returns 4051 using Build 220.
- Help with the next code to export data
- problem with FileOpen function - returns error at compile
- FileOpen Error
Call GetLastError() before perfroming the operation you think is a problem to clear out any old error.
...
...
int error;
... other code
error = GetLastError(); // clears error history
FileOpen(...)
error = GetLastError(); // now, there is either no error, or it contains the error that corresponds to the file operation.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register