Download MetaTrader 5
To add comments, please log in or register
Publish your application in Cobe Base. Millions of traders will see it!
PFX_1
9
PFX_1 2015.05.08 14:11 

Hi ,

After Moving to MT4 ver 600 and more , My Last code for opening the file met the problem.

You Can see the code and the Error Message : 

Also I'm running in wiondows8.1 X32 . Can anyone suggest a solution

 

void OnStart()

  {

//---

     int iErr=0;

   string terminal_data_path=TerminalInfoString(TERMINAL_DATA_PATH);

   string filename=terminal_data_path+"\\MQL4\\Files\\"+"Text.txt";

   int filehandle=FileOpen(filename,FILE_READ);

   if(filehandle<0) 

   { 

     iErr=GetLastError();

     Alert("Error code In File Opening is  Description : "+

         ErrorDescription(iErr)+ " : No:  "+ IntegerToString(iErr) );

   }

   else {

         Alert("Successful File Opening");

         FileClose(filehandle);

        }

  } 

Files:
Drazen Penic
2497
Drazen Penic 2015.05.08 14:22  

You don't need folder to write to the "Files" folder, it is default for the FileOpen() function.

Use this:

string filename="Text.txt";

 

And please, use "SRC" option when you enter source code in the post. 

PFX_1
9
PFX_1 2015.05.08 15:25  

Thank You I solved it by using the following

 

#import "kernel32.dll" 

 int ReadFile(int, uchar&[], int, int&[], int); 

 

that sounds good. 

/
To add comments, please log in or register