Errors, bugs, questions - page 2973

 
Denis Kirichenko:

Dear developers, please check if <Arrays\ArrayObj.mqh> is correct:

Technically there is no error. In this case virtual is implied, even if not explicitly specified

 
A100:

Technically, there is no error. In this case virtual is implied, even if not explicitly stated

Thank you. But I would like some syntactic uniformity. After all, we already have one, for example:

class CArrayDouble : public CArray
  {

   ...

   protected:
   virtual void      QuickSort(int beg,int end,const int mode=0);
  }

//+------------------------------------------------------------------+

class CArrayString : public CArray
   {

   ...

   protected:
   virtual void      QuickSort(int beg,int end,const int mode=0);
  }

 

The Market folder is full of experts

11

but I can only test the first 6

11

What is wrong and what should I do?

 

CryptDecode(CRYPT_BASE64 error

int OnInit()
{
   string text="";
   string res="";
   string key="fuyTkH3cd63K9Htrl2xdFgjerPjmla8h";

   text="indicator_chart_window";
   if(!CryptEncodeA(text,key,res))
      Print("Error: Encode:",GetLastError());

   Print(res);

   text="vj9jDk+GxxB4W1zQc4/rC4OPvttMcgcF5ZFVC7m7l50=";
   if(!CryptDecodeA(text,key,res))
      Print("Error: Decode:",GetLastError());

   Print(res);
   return(INIT_SUCCEEDED);
}

//------------------------------------------------------------------
bool CryptEncodeA(string InputText,string key,string &Output) {
   uchar scr[];
   uchar dst[];
   uchar res[];
   uchar key_aes256[];
   uchar key_base64[];
   StringToCharArray(InputText,scr);
   StringToCharArray(key,key_aes256);
   if(CryptEncode(CRYPT_AES256,scr,key_aes256,dst)==0) return(false);
   if(CryptEncode(CRYPT_BASE64,dst,key_base64,res)==0) return(false);
   Output = CharArrayToString(res);
   return(true);
}
//--
bool CryptDecodeA(string InputText,string key,string &Output) {
   uchar scr[];
   uchar dst[];
   uchar res[];
   uchar key_base64[];
   uchar key_aes256[];
   StringToCharArray(InputText,scr);
   StringToCharArray(key,key_aes256);
   if(CryptDecode(CRYPT_BASE64,scr,key_base64,dst)==0) return(false);
   if(CryptDecode(CRYPT_AES256,dst,key_aes256,res)==0) return(false);
   Output = CharArrayToString(res);
   return(true);
}

---

CryptEncodeA function creates a line that CryptDecodeA cannot decode and generates error "4029" in MT4, "4006" in MT5

Log line: vj9jDk+GxxB4W1zQc4/rC4OPvttMcgcF5ZFVC7m7l50=

If you remove the last "="-then it decrypts and there is no error.

In this case, php decrypts normally and correctly:

$secret_key = 'fuyTkH3cd63K9Htrl2xdFgjerPjmla8h';

$s = "indicator_chart_window";
$res = base64_encode(openssl_encrypt($s,"AES-256-ECB",$secret_key,OPENSSL_RAW_DATA));
echo $res.'<br>';

$s= "vj9jDk+GxxB4W1zQc4/rC54fEtkLAsAONkyeprqmMlw=";
$res = openssl_decrypt(base64_decode($s),"AES-256-ECB",$secret_key,OPENSSL_ZERO_PADDING|OPENSSL_RAW_DATA);
echo $res;

---

We encrypt the same line on the server: "indicator_chart_window"

We get the result:"vj9jDk+GxxB4W1zQc4/rC54fEtkLAsAONkyeprqmMlw="

Insert this line into the mql code and error again - remove the last "=" and everything works fine.

---

Put some random encryption key, the server got the string: "8CpXr3OlVlVhGs41syHA0+HqZKnatswQjRWn2fKYN4qN4=="

Inserted the string in the mql-code - error, removed one "=" leaving only one - worked fine (what was the key that created the string with two equals - could not reproduce)

I want an answer, maybe I'm doing something wrong!

 

No memory freeing during optimisation.

The screenshot shows memory consumption when using only one agent during optimization:

The bug is related to a similar design as below in the code, the bug doesn't show up here:

input int ii;//Для оптимизации
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
class My_class
  {
public:
   struct s_Frame_info
     {
      ulong          event_index;
      uchar          frame_id;
      int            data_size;
     };
   struct s_Frame
     {
      s_Frame_info   frame_info;
      uchar          data[];
     };
   s_Frame           _data_local[];

   void              GGG()
     {
      ArrayResize(_data_local,1024);
      for(int i1=0; i1<1024; i1++)
        {
         int len1=ArrayRange(_data_local[i1].data,0);
         ArrayResize(_data_local[i1].data,len1+1,128*1024);
        }
     }
  } *my_class;
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int OnInit()
  {
   my_class=new My_class();
   my_class.GGG();
   return INIT_SUCCEEDED;
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
   my_class._data_local[0].data[0]=0;
   delete my_class;
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
  }
//+------------------------------------------------------------------+

Any thoughts on this?

 
Denis Nikolaev:

The Market folder is full of experts

but I can only test the first 6

What is wrong and what should I do?

This is a four. Reached the limit of the number.

 

Why is test.mq5 compiled instead of test.mqproj ? while thetest.mqproj projectis closed

Only by deleting the filetest.mqproj everything is back to normal
 

Is it possible to upload a png file to MQL/Images folder in codebase?

The png files seem to be allowed, but for some reason they are not sent to the server - after submitting the form the png files are not in the uploaded list.

 
Artyom Trishkin:

That's a four. Reached the limit.

Thank you, Artem. The cleansing has helped.

 
Stanislav Korotky:

Is it possible to upload a png file to MQL/Images folder in codebase?

The png files seem to be allowed, but for some reason they are not sent to the server - after submitting the form the png files are not in the uploaded list.

I'll add more. I have archived all the files like with EasyAndFastGUI (https://www.mql5.com/ru/code/19703) and uploaded them to MQL5/Images. The zip file has been registered on the server, but the compilation is still not successful - the server says it doesn't see the resource files. Question: How did EasyAndFastGUI compile?

Or do I have to ask the moderators to manually push the submit again(https://www.mql5.com/en/code/33770/ - publicly unavailable)?

EasyAndFastGUI - библиотека для создания графических интерфейсов
EasyAndFastGUI - библиотека для создания графических интерфейсов
  • www.mql5.com
Библиотека EasyAndFastGUI дает возможность создавать графические интерфейсы для своих MQL-программ.
Reason: