Errori, bug, domande - pagina 2115

 
Andrey Voytenko:

Sembra che se si usa il commento di posizione il più possibile (31 caratteri) allora non c'è più spazio per visualizzare l'ID nel tooltip.

Non si direbbe subito!
 

Buon pomeriggio!

Qualcuno ha un EA che invia frequenti email?

Quanti ne riceve all'ora, al giorno?

Ho avuto 16 email inviate in 5 minuti e il registro è stato vuoto per alcune ore e poi ha iniziato a scrivere

Posta: non c'è abbastanza spazio per


Chi ha esperienza su questo argomento.

P.S. Gmail google ti permette di ricevere email ogni secondo, presumo che le email si accumulino più velocemente nella coda del terminale/server e siano inviate più lentamente (quanto?)

E ancora una volta il consigliere/terminale cerca di mettere in coda l'e-mail, e la coda è già piena!!!

 
Roni Iron:

Buon pomeriggio!

Qualcuno ha un EA che invia frequenti email?

Quanti ne riceve all'ora, al giorno?

Ho avuto 16 email inviate in 5 minuti e il registro è stato vuoto per alcune ore e poi ha iniziato a scrivere

Posta: non c'è abbastanza spazio per


Chi ha esperienza su questo argomento.

P.S. Gmail google ti permette di ricevere email ogni secondo, presumo che le email si accumulino più velocemente nella coda del terminale/server e siano inviate più lentamente (quanto?)

E ancora una volta il consigliere/terminale cerca di mettere in coda l'e-mail, e la coda è già piena!!!


Perché? Hanno inventato PUSH molto tempo fa

 
fxsaber:

Errore nella documentazione


fxsaber:

Errore nella documentazione

Grazie, lo sistemeremo.

 
A100:

Ho incontrato ripetutamente sul forum degli utenti discussioni sulla mancanza di MetaEditor di una macro predefinita simile a _WIN64. La risposta dell'amministrazione è stata che non ce n'è bisogno perché MetaEditor genera codice universale a 32-64 bit allo stesso tempo.

Allo stesso tempo, molte persone usano l'allineamento https://www.mql5.com/ru/forum/225498/page2#comment_6401835 aggiungendo i campi alla struttura

E infatti, se si usa una .dll già pronta (che non può più essere modificata), non si può fare a meno di un allineamento aggiuntivo. Ma in x86 e x64 questa aggiunta può sembrare diversa, il che significa che l'analogo _WIN64 è ancora necessario perché la struttura è definita nella fase di compilazione del file .mq5 dove TerminalInfoInteger( TERMINAL_X64 ) non funziona

Ora dobbiamo tenere a mente un'informazione in più. Come risultato di risparmiare su un'inezia, c'è il rischio di ottenere un errore sfuggente

Ecco un esempio dagli sviluppatori - GetOpenFileName che funziona in x64 e x86. Vedi se risolve il problema

//+------------------------------------------------------------------+
//|                                                   GetOpenFileName|
//|                                      Copyright 2012, CompanyName |
//|                                       http://www.companyname.net |
//+------------------------------------------------------------------+

struct SNativeStr64;
struct SNativeStr32;

#import "kernel32.dll"
int  GetLastError();
//--- x64
long LocalAlloc(uint flags,long uBytes);
void LocalFree(long memptr);
int  lstrlenW(long ptr);    // 64 bit
long lstrcpyW(long dst,const string src);
long lstrcpyW(string &dst,long src);

//--- x86
int  LocalAlloc(uint flags,int uBytes);
void LocalFree(int memptr);
int  lstrcpyW(int dst,const string src);
int  lstrlenW(int ptr);     // 32 bit
int  lstrcpyW(string &dst,int src);
#import

#define  OFN_PATHMUSTEXIST  0x00000800
#define  OFN_FILEMUSTEXIST  0x00001000
#define  OFN_HIDEREADONLY   0x00000004
#define  LMEM_ZEROINIT      0x40

struct OPENFILENAME32;
struct OPENFILENAME64;

#import "Comdlg32.dll"
int GetOpenFileNameW(OPENFILENAME64 &ofn);
int GetOpenFileNameW(OPENFILENAME32 &ofn);
#import
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
template<typename T>
struct SNativeStr
  {
private:
                     SNativeStr(const SNativeStr &) { }

protected:
   T                 ptr;

public:
                     SNativeStr():ptr(0) { }
                    ~SNativeStr() { Clear(); }
   void              Clear(void) { if(ptr!=0) { LocalFree(ptr); ptr=0; } }
   T                 Detach(void) { T p=ptr; ptr=0; return(p); }

   int               Length(void) const { return(ptr==0?0:kernel32::lstrlenW(ptr)); }
   bool              Reserv(uint length) { Clear(); return((ptr=LocalAlloc(LMEM_ZEROINIT,T(sizeof(ushort)*(length+1))))!=0); }
   void              operator=(const string str)
     {
      Clear();
      ptr=LocalAlloc(LMEM_ZEROINIT,T(sizeof(ushort)*(StringLen(str)+2)));
      lstrcpyW(ptr,str);
     }
   bool              GetValue(string &str)
     {
      if(ptr==0)
         str=NULL;
      else
        {
         if(!StringInit(str,Length()))
            return(false);
         lstrcpyW(str,ptr);
        }
      //---
      return(true);
     }
  };

struct SNativeStr64 : public SNativeStr<long> { };
struct SNativeStr32 : public SNativeStr<int>  { };
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
struct OPENFILENAME64
  {
   uint              lStructSize;
   uint              dummy1;
   long              hwndOwner;
   long              hInstance;
   SNativeStr64      lpstrFilter;
   SNativeStr64      lpstrCustomFilter;
   uint              nMaxCustFilter;
   uint              nFilterIndex;
   SNativeStr64      lpstrFile;
   uint              nMaxFile;
   uint              dummy2;
   SNativeStr64      lpstrFileTitle;
   uint              nMaxFileTitle;
   uint              dummy3;
   SNativeStr64      lpstrInitialDir;
   SNativeStr64      lpstrTitle;
   uint              Flags;
   ushort            nFileOffset;
   ushort            nFileExtension;
   SNativeStr64      lpstrDefExt;
   long              lCustData;
   long              lpfnHook;
   long              lpTemplateName;
   long              pvReserved;
   uint              dwReserved;
   uint              FlagsEx;
   
   OPENFILENAME64()
      : lStructSize(sizeof(OPENFILENAME64))
      , dummy1(0)
      , hwndOwner(0)
      , hInstance(0)
      , nMaxCustFilter(0)
      , nFilterIndex(0)
      , nMaxFile(0)
      , dummy2(0)
      , nMaxFileTitle(0)
      , dummy3(0)
      , Flags(0)
      , nFileOffset(0)
      , nFileExtension(0)
      , lCustData(0)
      , lpfnHook(0)
      , lpTemplateName(0)
      , pvReserved(0)
      , dwReserved(0)
      , FlagsEx(0)
     {
     }
  };
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
struct OPENFILENAME32
  {
   uint              lStructSize;
   int               hwndOwner;              // HWND
   int               hInstance;              // HINSTANCE
   SNativeStr32      lpstrFilter;
   SNativeStr32      lpstrCustomFilter;
   uint              nMaxCustFilter;
   uint              nFilterIndex;
   SNativeStr32      lpstrFile;
   int               nMaxFile;
   SNativeStr32      lpstrFileTitle;
   uint              nMaxFileTitle;
   SNativeStr32      lpstrInitialDir;
   SNativeStr32      lpstrTitle;
   uint              Flags;
   ushort            nFileOffset;
   ushort            nFileExtension;
   SNativeStr32      lpstrDefExt;
   int               lCustData;
   int               lpfnHook;
   int               lpTemplateName;
   int               pvReserved;
   uint              dwReserved;
   uint              FlagsEx;
   
   OPENFILENAME32()
      : lStructSize(sizeof(OPENFILENAME32))
      , hwndOwner(0)
      , hInstance(0)
      , nMaxCustFilter(0)
      , nFilterIndex(0)
      , nMaxFile(0)
      , nMaxFileTitle(0)
      , Flags(0)
      , nFileOffset(0)
      , nFileExtension(0)
      , lCustData(0)
      , lpfnHook(0)
      , lpTemplateName(0)
      , pvReserved(0)
      , dwReserved(0)
      , FlagsEx(0)
     {
     }            
  };
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
bool GetOpenFileName(string &path,const string filter,const string initial_dir,const string title)
  {
   int res;

   if(_IsX64)
     {
      OPENFILENAME64 ofn;

      ofn.lStructSize=(uint)sizeof(ofn);
      ofn.lpstrFile.Reserv(1024);
      ofn.nMaxFile   =1024;
      ofn.Flags      =OFN_PATHMUSTEXIST|OFN_FILEMUSTEXIST|OFN_HIDEREADONLY;
      ofn.lpstrFilter=filter;
      ofn.lpstrInitialDir=initial_dir;
      ofn.lpstrTitle=title;

      if((res=GetOpenFileNameW(ofn))==1)
        {
         StringInit(path,1024);
         ofn.lpstrFile.GetValue(path);
        }
     }
   else
     {
      OPENFILENAME32 ofn;

      ofn.lStructSize=(uint)sizeof(ofn);
      ofn.lpstrFile.Reserv(1024);
      ofn.nMaxFile   =1024;
      ofn.Flags      =OFN_PATHMUSTEXIST|OFN_FILEMUSTEXIST|OFN_HIDEREADONLY;
      ofn.lpstrFilter=filter;
      ofn.lpstrInitialDir=initial_dir;
      ofn.lpstrTitle=title;

      if((res=GetOpenFileNameW(ofn))==1)
        {
         StringInit(path,1024);
         ofn.lpstrFile.GetValue(path);
        }
     }
//---
   return(res!=0);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void OnStart()
  {
   string path;
   if(GetOpenFileName(path,"Source code\0*.mq5\0",TerminalInfoString(TERMINAL_DATA_PATH)+"\\MQL5\\Experts\\","Select source file"))
      Print(path);
   else
      PrintFormat("Failed with error: %x",kernel32::GetLastError());
  }
//+------------------------------------------------------------------+
 
Rashid Umarov:

Ecco un esempio dagli sviluppatori - GetOpenFileName, che funziona in x64 e x86. Vedi se risolve il problema

Infatti, richiede quasi il doppio del codice,

void OnStart()
{
    _IsX64 ? OnStart64() : OnStart32();
}

mentre i programmi con .dll non sono per il segmento di massa
Ancora una volta ci deve essere una scelta: Compilazione divisa (32\64) e il doppio del codice
o universalità e una notevole complicazione del codice.
Inoltre, potete introdurre l'analogo di _WIN64 secondo il principio _IsX64 (non è documentato ma potete usarlo)

 

Un ulteriore argomento è che spesso c'è solo una .dll allegata a un progetto (o solo x86 o solo x64) e non si può specificare una linea come questa nel file .mqh di quel progetto

#ifndef _WIN64
Не_поддерживается
#endif
Per esempio qui https://www.mql5.com/ru/forum/224745
ATcl - интерпретатор Tcl для MT4
ATcl - интерпретатор Tcl для MT4
  • 2018.01.15
  • www.mql5.com
Праздники прошли плодотворно, и представляю на суд общественности ATcl - встроенный интерпретатор Tcl в MT4...
 

Esempio di aiuto

//+------------------------------------------------------------------+ 
//| Cоздает прямоугольник по заданным координатам                    | 
//+------------------------------------------------------------------+ 
bool RectangleCreate(const long            chart_ID=0,        // ID графика 
                     const string          name="Rectangle",  // имя прямоугольника 
                     const int             sub_window=0,      // номер подокна  
                     datetime              time1=0,           // время первой точки 
                     double                price1=0,          // цена первой точки 
                     datetime              time2=0,           // время второй точки 
                     double                price2=0,          // цена второй точки 
                     const color           clr=clrRed,        // цвет прямоугольника 
                     const ENUM_LINE_STYLE style=STYLE_SOLID, // стиль линий прямоугольника 
                     const int             width=1,           // толщина линий прямоугольника 
                     const bool            fill=false,        // заливка прямоугольника цветом            < --- Есть только тут  дальше в коде нет
                     const bool            back=false,        // на заднем плане 
                     const bool            selection=true,    // выделить для перемещений 
                     const bool            hidden=true,       // скрыт в списке объектов 
                     const long            z_order=0)         // приоритет на нажатие мышью 
  { 
//--- установим координаты точек привязки, если они не заданы 
   ChangeRectangleEmptyPoints(time1,price1,time2,price2); 
//--- сбросим значение ошибки 
   ResetLastError(); 
//--- создадим прямоугольник по заданным координатам 
   if(!ObjectCreate(chart_ID,name,OBJ_RECTANGLE,sub_window,time1,price1,time2,price2)) 
     { 
      Print(__FUNCTION__, 
            ": не удалось создать прямоугольник! Код ошибки = ",GetLastError()); 
      return(false); 
     } 
//--- установим цвет прямоугольника 
   ObjectSetInteger(chart_ID,name,OBJPROP_COLOR,clr); 
//--- установим стиль линий прямоугольника 
   ObjectSetInteger(chart_ID,name,OBJPROP_STYLE,style); 
//--- установим толщину линий прямоугольника 
   ObjectSetInteger(chart_ID,name,OBJPROP_WIDTH,width); 
//--- отобразим на переднем (false) или заднем (true) плане 
   ObjectSetInteger(chart_ID,name,OBJPROP_BACK,back); 
//--- включим (true) или отключим (false) режим выделения прямоугольника для перемещений 
//--- при создании графического объекта функцией ObjectCreate, по умолчанию объект 
//--- нельзя выделить и перемещать. Внутри же этого метода параметр selection 
//--- по умолчанию равен true, что позволяет выделять и перемещать этот объект 
   ObjectSetInteger(chart_ID,name,OBJPROP_SELECTABLE,selection); 
   ObjectSetInteger(chart_ID,name,OBJPROP_SELECTED,selection); 
//--- скроем (true) или отобразим (false) имя графического объекта в списке объектов 
   ObjectSetInteger(chart_ID,name,OBJPROP_HIDDEN,hidden); 
//--- установим приоритет на получение события нажатия мыши на графике 
   ObjectSetInteger(chart_ID,name,OBJPROP_ZORDER,z_order); 
//--- успешное выполнение 
   return(true); 
  } 

Da qui la domanda, come cambiare il riempimento inOBJ_RECTANGLE in mt 4?

 
Il nostro obiettivo è quello di fermare presto lo sviluppo delle versioni a 32 bit di Metatrader.

Il problema del supporto della dll a 32 bit scomparirà automaticamente.
 

Renat Fatkhullin:
Мы нацелены вообще скоро остановить разработки 32 битных версий Метатрейдера.

Si consiglia di correggere tutti gli errori di runtime conosciuti a questo punto, per esempio questo #1841289 https://www.mql5.com/ru/forum/1111/page2025#comment_5766707

Il comportamento di questo e di altri operatori non corrisponde ai metodi. Mentre l'operatore in relazione ai metodi non è altro che zucchero sintattico

Ошибки, баги, вопросы
Ошибки, баги, вопросы
  • 2017.09.15
  • www.mql5.com
Общее обсуждение: Ошибки, баги, вопросы