Download MetaTrader 5

Error Code 5004

To add comments, please log in or register
How to use MQL5.community messages editor? Find out in the article!
RaisingFire
49
RaisingFire 2014.03.06 08:50 

Hallo,


I just update my MT4 FXDD client terminal. The new updated client terminal gave an error code: 5004 which I didn't have in the old MT4 client terminal. I understand that error 5004 is about fileopen error. I have checked and I have done "fileclose" for every "fileopen".

I have also checked the permission of Windows 7, and I don't change anything.

I have installed the FXDD MT4 client terminal in 2 different notebooks. In one of the notebooks, during the installation, I have made all the firewall and antivirus inactive.

And still it returns me the same error code 5004.

During my debugging process of the problem, I put an alert following the Fileopen was a checking either successful or failed. And the result was, it was around 10 times successful fileopen and once failed (last error 5004).

In addition, the error code 5004 doesn’t seem to affect my EA performance so far (my EA still performs as usual) although the error 5004 keeps popping up. The fact remains that the old MT4 didn’t return me that kind of error ( and I reckon it shouldn’t).


Your help will be much appreciated.

Simon Gniadkowski
Moderator
18001
Simon Gniadkowski 2014.03.06 09:02  
raisingfire:

Hallo,


I just update my MT4 FXDD client terminal. The new updated client terminal gave an error code: 5004 which I didn't have in the old MT4 client terminal. I understand that error 5004 is about fileopen error. I have checked and I have done "fileclose" for every "fileopen".

What build are you using ?

Did you recompile or are you using the build 509 compiled .ex4 ?

Alain Verleyen
Moderator
30737
Alain Verleyen 2014.03.06 13:38  
raisingfire:

Hallo,


I just update my MT4 FXDD client terminal. The new updated client terminal gave an error code: 5004 which I didn't have in the old MT4 client terminal. I understand that error 5004 is about fileopen error. I have checked and I have done "fileclose" for every "fileopen".

I have also checked the permission of Windows 7, and I don't change anything.

I have installed the FXDD MT4 client terminal in 2 different notebooks. In one of the notebooks, during the installation, I have made all the firewall and antivirus inactive.

And still it returns me the same error code 5004.

During my debugging process of the problem, I put an alert following the Fileopen was a checking either successful or failed. And the result was, it was around 10 times successful fileopen and once failed (last error 5004).

In addition, the error code 5004 doesn’t seem to affect my EA performance so far (my EA still performs as usual) although the error 5004 keeps popping up. The fact remains that the old MT4 didn’t return me that kind of error ( and I reckon it shouldn’t).


Your help will be much appreciated.

Welcome to mql4.com forum,

Can you provide a snippet of code to reproduce this issue ?

RaisingFire
49
RaisingFire 2014.03.07 08:54  
RaptorUK:

What build are you using ?

Did you recompile or are you using the build 509 compiled .ex4 ?

The new client terminal is build 610.
RaisingFire
49
RaisingFire 2014.03.07 08:59  
angevoyageur:

Welcome to mql4.com forum,

Can you provide a snippet of code to reproduce this issue ?



Here is a snipped of code (alert) that keeps popping up:

mfilename = StringSubstr(OrderTicket(),StringLen(OrderTicket())-7,7) + ".DAT";

fhandle=FileOpen(mfilename, FILE_BIN|FILE_READ);

if(fhandle<=0)

{ Alert( "File:", mfilename, " not found, the last error is: ", GetLastError());

filewriting(mfilename); }

if(fhandle>0)

FileClose(fhandle);

RaisingFire
49
RaisingFire 2014.03.07 09:00  
raisingfire:
The new client terminal is build 610.

And yes I have recompiled it.
Simon Gniadkowski
Moderator
18001
Simon Gniadkowski 2014.03.07 09:14  
raisingfire:

And yes I have recompiled it.
OK, I think to get some specific help you will need to show your code, if you do please use the SRC button
RaisingFire
49
RaisingFire 2014.03.07 09:39  
RaptorUK:
OK, I think to get some specific help you will need to show your code, if you do please use the SRC button


Do I need to upload the whole source code ? If I do, then, I need a special clearance from our management ... not my power to decide.
Simon Gniadkowski
Moderator
18001
Simon Gniadkowski 2014.03.07 10:01  
raisingfire:

Do I need to upload the whole source code ? If I do, then, I need a special clearance from our management ... not my power to decide.
Could you post the section of code that opens the file handle and writes to the file ? or if not can you explain if you are using standard mql4 file functions or are you using DLL calls ?
RaisingFire
49
RaisingFire 2014.03.07 10:04  
RaptorUK:
Could you post the section of code that opens the file handle and writes to the file ? or if not can you explain if you are using standard mql4 file functions or are you using DLL calls ?

This is the section that open the file and close the file :

**============================================

mfilename = StringSubstr(OrderTicket(),StringLen(OrderTicket())-7,7) + ".DAT";

fhandle=FileOpen(mfilename, FILE_BIN|FILE_READ);

if(fhandle<=0)

{ Alert( "File:", mfilename, " not found, the last error is: ", GetLastError());

filewriting(mfilename); }

if(fhandle>0)

FileClose(fhandle);

** =============================================

I use the standard MQL4 file functions, not DLL calls. I tried to put a remark on the "if(handle>0)", so, it forces to do fileclose. But, it still gives me that error code.

Simon Gniadkowski
Moderator
18001
Simon Gniadkowski 2014.03.07 10:06  
raisingfire:

This is the section that open the file and close the file :

RaptorUK:
if you do please use the SRC button
1234
To add comments, please log in or register