Download MetaTrader 5

Build 600 has this bug

To add comments, please log in or register
The Market has more than 400 indicators. Try any of them!
Saravanakumar D
360
Saravanakumar D 2014.02.04 12:20 

Dear Brothers I founded a bug

I was using this code to export the data file to c:\Data before updated to build 600

#import "shell32.dll"
int ShellExecuteA(int hwnd,string Operation,string File,string Parameters,string Directory,int ShowCmd);
#import
//+------------------------------------------------------------------+
//| script program start function                                    |
//+------------------------------------------------------------------+

int start()
{
//----
  
   string file_src_path = TerminalPath()+"\experts\files\*.csv";
   string file_dst_path = "C:\Data";
   string file_path = "/c move /y "+"\""+file_src_path+"\""+" "+"\""+file_dst_path+"\"";
   string cysymbol = Symbol();
   int cytfs[] = {PERIOD_D1,PERIOD_W1};
   int num_tfs = ArraySize(cytfs);
   int cur_tf,j;
   for (j=0; j<num_tfs; j++)
   {
      cur_tf = cytfs[j];
      exportfle (cysymbol,cur_tf);
   }
   ShellExecuteA(0, "Open","cmd.exe", file_path , "", 0);
   return(0);

it was working fine. I updated to build 600 and changed the code like as alexvd told

string file_src_path = TerminalInfoString(TERMINAL_DATA_PATH)+"\MQL4\Files\*.csv"";

the file stored well in the Terminal Data Folder

C:\Users\User_account_name\AppData\Roaming\MetaQuotes\Terminal\Instance_id\MQL4\Files

But it's not moving the files to path C:\Data

Because of the windows file handler ShellExecuteA is not executed

Kindly Fix the Problem


With Thanks and Regards

Saravana
Slawa
Moderator
6839
Slawa 2014.02.04 12:35  
d.saravana21:

Because of the windows file handler ShellExecuteA is not executed



ShellExecuteW?
gchrmt4
356
gchrmt4 2014.02.04 12:47  
stringo:

ShellExecuteW?
(This is a good example where neither the old EX4 nor the old MQ4 is backward-compatible. The old EX4 is not backward-compatible because there is a - reasonable - expectation that FileOpen() will use experts\files. The old MQ4 is not backward-compatible because TerminalPath() has to be changed, and DLL calls have to be changed from A to W.)
Saravanakumar D
360
Saravanakumar D 2014.02.04 12:53  
@Stringo Thank you so much bro.. it's working well..
Slawa
Moderator
6839
Slawa 2014.02.04 13:53  
gchrmt4:
(This is a good example where neither the old EX4 nor the old MQ4 is backward-compatible. The old EX4 is not backward-compatible because there is a - reasonable - expectation that FileOpen() will use experts\files. The old MQ4 is not backward-compatible because TerminalPath() has to be changed, and DLL calls have to be changed from A to W.)

Old EX4 (not touched by new compiler) still work.

If you want recompile old sources then see list of changes before

gchrmt4
356
gchrmt4 2014.02.04 13:56  
stringo:

Old EX4 (not touched by new compiler) still work.

If you want recompile old sources then see list of changes before

No, in this example it does not work.

The above script creates a CSV file and then tries to move it from experts\files to C:\Data. The script does not work because the CSV file is no longer in experts\files. The old EX4 has to be replaced, and the old MQ4 also has to be changed.

Moving FileOpen() from experts\files for existing EX4 files breaks backward-compatibility for any EX4 files - like this one - which expect FileOpen() to use experts\files.

Saravanakumar D
360
Saravanakumar D 2014.02.04 14:00  

@Gchrmt4 is right.. the old one will work only with starting the terminal "/portable" switch

gchrmt4
356
gchrmt4 2014.02.04 14:01  
d.saravana21:

@Gchrmt4 is right.. the old one will work only with starting the terminal with "/portable" switch

(It shouldn't even work them. With /portable, MT4 uses MQL4\files, not experts\files.)
gchrmt4
356
gchrmt4 2014.02.04 14:08  
stringo:

Old EX4 (not touched by new compiler) still work.

FYI, I first raised this issue with the Service Desk 6 weeks ago but, like you, they have repeatedly given the wrong answer and ignored the problem.
Slawa
Moderator
6839
Slawa 2014.02.04 14:13  
gchrmt4:
FYI, I first raised this issue with the Service Desk 6 weeks ago but, like you, they have repeatedly given the wrong answer and ignored the problem.

I remember.

Behavior will not changed. No more chance to store data in the Program Files folder. Better now than too late, when /portable key will have no sence...

gchrmt4
356
gchrmt4 2014.02.04 14:16  
stringo:

I remember.

Behavior will not changed. No more chance to store data in the Program Files folder. Better now than too late, when /portable key will have no sence...

Yes, it's too late to change it now. But thank you for finally admitting that backward compatibility is broken for some EX4 files.
12
To add comments, please log in or register