Errors, bugs, questions - page 2115

 
Andrey Voytenko:

It seems that if you use the position comment as much as possible (31 characters) then there is no more room to display the ID in the tooltip.

You wouldn't know it right away!
 

Good afternoon!

Does anyone have an EA that sends frequent emails?

How many do you get per hour, per day?

I had 16 emails sent in 5 minutes and the log was empty for a few hours and then it started to write

Mail: not enough space for


Who has any experience on this subject.

P.S. Gmail google allows you to get emails every second , I assume that emails pile up faster in the terminal/server queue and are sent slower (how much ?)

And once again the advisor/terminal is trying to queue the email , and the queue is already full !!!

 
Roni Iron:

Good afternoon!

Does anyone have an EA that sends frequent emails?

How many do you get per hour, per day?

I had 16 emails sent in 5 minutes and the log was empty for a few hours and then it started to write

Mail: not enough space for


Who has any experience on this subject.

P.S. Gmail google allows you to get emails every second , I assume that emails pile up faster in the terminal/server queue and are sent slower (how much ?)

And once again the advisor/terminal is trying to queue the email , and the queue is already full !!!


why? they invented PUSH a long time ago

 
fxsaber:

Error in the documentation


fxsaber:

Error in the documentation

Thank you, we'll fix it.

 
A100:

I have repeatedly encountered discussion on the forum of users about MetaEditor's lack of a predefined macro similar to _WIN64. The administration's answer was that there is no need because MetaEditor generates universal 32-64-bit code at the same time.

At the same time, many people use the https://www.mql5.com/ru/forum/225498/page2#comment_6401835 alignment by appending the fields to the structure

And indeed, if you use a ready-made .dll (which cannot be changed anymore), you cannot do without additional alignment. But in x86 and x64 this addition may look different, which means that the _WIN64 analog is still needed because the structure is defined at the stage of compiling .mq5 file where TerminalInfoInteger( TERMINAL_X64 ) does not work

Now we have to keep extra information in mind. As a result of saving on a trifle, there is a risk of getting an elusive error

Here is an example from the developers - GetOpenFileName which works in x64 and x86. See if it solves the issue

//+------------------------------------------------------------------+
//|                                                   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:

Here is an example from the developers - GetOpenFileName, which works in x64 and x86. See if it solves the issue

In fact, it requires almost twice as much code,

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

while programs with .dll are not for the mass segment
Again there must be a choice: Split (32\64) compilation and twice as much code
or universality and considerable code complication.
Besides, you may introduce the _WIN64 analogue according to the _IsX64 principle (it is not documented but you may use it)

 

An additional argument is that often there is only one .dll attached to a project (either x86 only or x64 only) and you cannot specify a line like this in the .mqh file of that project

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

Example from help

//+------------------------------------------------------------------+ 
//| 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); 
  } 

Hence the question, how to change the fill inOBJ_RECTANGLE in mt 4 ???

 
We aim to stop development of 32 bit versions of Metatrader altogether soon.

The problem with 32 bit dll support will disappear automatically.
 

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

It is desirable to correct all known runtime errors at this point, e.g. this #1841289 https://www.mql5.com/ru/forum/1111/page2025#comment_5766707

The behaviour of this and other operators does not correspond to methods. While operator in relation to methods is nothing more than syntactic sugar

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