WindowScreenShot problem - page 2

 
RaptorUK:

Please show the part of the log file showing the errors . . .
eg:

05:39:33 T_AutoWindowShots GBPUSD,H1: Alert: 23:59:58trade_mode: T_ScreenShot, Schoted file open error: (GBPUSD 4103): cannot open file

05:43:51 T_AutoWindowShots GBPNZD,H1: Alert: 23:59:58trade_mode: T_ScreenShot, Schoted file open error: (GBPNZD 4103): cannot open file

05:43:51 T_AutoWindowShots GBPCAD,H1: Alert: 23:59:58trade_mode: T_ScreenShot, Schoted file open error: (GBPCAD 4103): cannot open file

 
ttechnik:
eg:

05:39:33 T_AutoWindowShots GBPUSD,H1: Alert: 23:59:58trade_mode: T_ScreenShot, Schoted file open error: (GBPUSD 4103): cannot open file

05:43:51 T_AutoWindowShots GBPNZD,H1: Alert: 23:59:58trade_mode: T_ScreenShot, Schoted file open error: (GBPNZD 4103): cannot open file

05:43:51 T_AutoWindowShots GBPCAD,H1: Alert: 23:59:58trade_mode: T_ScreenShot, Schoted file open error: (GBPCAD 4103): cannot open file

Please add the filename to what you are printing out/alerting . . . do you have sufficient disk space ? perhaps the file has not yet closed from WindowScreenShot() when you are trying to open it . . . have you checked that the file exists ? it must otherwise WindowScreenShot() would have returned -1 and you would have printed/alerted another error . . .

 

log fine name is 20140118.log

disk space is enough.

i trying to open after WindowScreen()

the error is when i checked that file exists.

WindowScreenShot() returned without error! But not writed a file.

.....and I quit the MT4 and re run it, after run correctly

 
ttechnik:

log fine name is 20140118.log

No, what is the name of the file that fails when you try and open it for reading ? please add the filename variable to your Alert . . .

int handle = FileOpen(filename, FILE_BIN|FILE_READ); 
if (handle>-1)
    {
     error=GetLastError();
     if (error!=0) Alert(TimeToStr(TimeCurrent(),TIME_SECONDS)," trade_mode: ", trade_mode, " T_ScreenShot FileWrite1 filename: " filename, " , error: ( ",Symbol(),"  ", error,"): ",ErrorDescription(error));
     FileClose(handle);
    } 
 
RaptorUK:

No, what is the name of the file that fails when you try and open it for reading ? please add the filename variable to your Alert . . .


ok, thx

I'll check if the fault arises again
 
ttechnik:
RaptorUK:
How do you make them unique ?

string timestamp = TimeToStr(TimeCurrent(),TIME_SECONDS);
filename = filename + "_" + timestamp +  ".gif";

It seems your unique file name contains ':' (zweipunkt)

 
RaptorUK:

No, what is the name of the file that fails when you try and open it for reading ? please add the filename variable to your Alert . . .


It works good, today.

But now wrong in time.

filename eg.:

Alert: 596588\\WindowShots GBPCAD\\2014 1\\GBPCAD_2014-01-20 14-17-09.gif

 
Ovo:

It seems your unique file name contains ':' (zweipunkt)


Yes, I fogot pasting of whole code.


string timestamp = TimeToStr(TimeCurrent(),TIME_DATE )+" "+TimeToStr(TimeCurrent(),TIME_SECONDS);
  for (int i= StringLen(timestamp); i>0; i--)
    if (StringFind(timestamp,":",i)!=-1 || StringFind(timestamp,".",i)!=-1) timestamp= StringSetChar(timestamp, i, '-');
          
  string filename = mappa + CharToStr(92) + CharToStr(92) + Symbol();
  if (ticket!=0)      filename = filename + "_" + DoubleToStr(ticket,0);
  if (order!="")      filename = filename + "_" + order;
  if (type!=-1)       filename = filename + "_" + OrdertypeToString(type);
  if (trade_mode!="") filename = filename + "_" + trade_mode;
  
  filename = filename + "_" + timestamp +  ".gif";
 
RaptorUK:

No, what is the name of the file that fails when you try and open it for reading ? please add the filename variable to your Alert . . .


What is your idea for my problem, please?
 
ttechnik:

What is your idea for my problem, please?
I have no idea, I'm trying to get you to add in enough debugging information to be able to diagnose the issue . . . but you seem to be resistant to the idea.
Reason: