Error Code 5004

 

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.

 
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 ?

 
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 ?

 
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.
 
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:
The new client terminal is build 610.

And yes I have recompiled it.
 
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
 
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.
 
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 ?
 
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.

 
raisingfire:

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

RaptorUK:
if you do please use the SRC button