Errors, bugs, questions - page 2732

 
Vladimir Karputov:

Start the search (any search, any name) and stop the search immediately. This will bring up a search bar where you can select the file type:


Oops... Thank you.
 
Artyom Trishkin:

I know I need to find the video files. Everything. Absolutely. And what type and name they are, let the machine itself look for them.

It's hard to guess how the machine searches, but how to search in DOS (press Win+R and write cmd), like this:

dir/b/s  *.3 g2 *.3 gp *.3 gp2 *.3 gpp *.3 gpp2 *.asf *.asx *.avi *.bin *.dat *.drv *.f4v *.flv *.gtp *.h264 *.m4v *.mkv *.mod *.moov *.mov *.mp4 *.mpeg *.mpg *.mts *.rm *.rmvb *.spl *.srt *.stl *.swf *.ts *.vcd *.vid *.vid *.vid *.vob *.webm *.wm *.wmv *.yuv > d:\filename.txt

I googled the first websitehttp://fileext.ru/video, pasted it into Excel, so that it would be in columns, then into notepad

last parameter where to write search data with paths and file names d:\filename.txt

I checked. It's working.... but my binary has nothing to do with video ))))

 
Compilation with MQL5 cloud protection seems to hang the editor in the absence of internet. At first it hangs gently (i.e. the editor is available for other actions, but the compile command is waiting for completion and it is not clear how long to wait if there is a timeout). If the Cancel button is pressed, it hangs tightly.
 

I want to return the string from .dll to MQL4 (MQL5 has no problems at all)

I've already made a lot of mistakes, so I need to ask the knowledgeable: What is an array of strings in memory? - What is an array of strings?

string s_arr_1[];
// эти массивы чем-нибудь отличаются?
string s_arr_2[10];
 
Igor Makanu:

I want to return the string from .dll to MQL4 (MQL5 has no problems at all)

I've already made a lot of mistakes, so I need to ask the knowledgeable: What is an array of strings in memory? - What is an array of strings?

A string array is an array of string objects. Somewhere, one of the developers wrote that there are two fields: a pointer to a string and 32 bits of allocated memory size. In general, it would be nice to write such things in the official docs, so as not to guess.
 
Igor Makanu:

what is an array of strings in memory? - what is a string array?!

About MASSIVE data structure.
I am describing it for MT5, the same should be for MT4 as well, probably something will be different, but it should be close.

In general, the array consists of two parts: description and data, but it may also consist of data only.
Data is the memory allocated for the array elements.
Description - the structure containing the following fields, the sequence is not saved:

flags - set of flags describing the array: IsDynamic, IsSetAsSerrias, IsIndexBuffer, ...
size - number of created elements in the array;
capacity - number of reserved elements in the array;
constructor pointer - pointer to the constructor function for the array elements;
destructor pointer - pointer to the destructor function for the array elements;
data pointer - pointer to the beginning of the array.

string s_arr_1[];- dynamic array which consists of a description and a data array.
string s_arr_2[10]; - the array type depends on the string location:
if used as a local variable, it is a static array, which consists of a description and an array of data, located sequentially on the stack.
if used as a field in a structure/class, it is just a data array (there is no description part).
 
Sergey Dzyublik:

About data structure MASSIVE.
This is a description from memory and for MT5, the same should be for MT4 as well, probably something will be different but it should be close.

In general, the array consists of two parts: description and data, but it may also consist of data only.
Data is the memory allocated for the array elements.
Description - the structure containing the following fields, the sequence is not saved:

flags - a set of flags describing the array: IsDynamic, IsSetAsSerrias, IsIndexBuffer, ...
size - number of created elements in the array;
capacity - number of reserved elements in the array;
constructor pointer - pointer to the constructor function for the array elements;
destructor pointer - pointer to the destructor function for the array elements;
data pointer - pointer to the beginning of an array.

string s_arr_1[];- dynamic array, which consists of a description and a data array.
string s_arr_2[10]; - array type depends on string location:
if used as a local variable, it is a static array, which consists of a description and an array of data, located sequentially on the stack.
if used as a field in a structure/class, it is just a data array (there is no description part).

Thank you!

There was a hope that maybe some standard structure from WinAPI exists, but apparently it can't be the same with strings

SZZ: I have fixed the exchange with dll, but as before in 2 calls - request for action in dll and return the required buffer size for string and the 2nd call with string copying into the prepared buffer, ok, the problem is local, but I was hoping that I would simplify the solution


Vladimir Simakov:
An array of strings is an array of string objects. Somewhere, some developer wrote that there are two fields: a pointer to a string and 32 bits of allocated memory size. In general, it would be nice to write such things in official docs, so as not to guess.

the main problem is that MQL4 and 5 are very different programs ))))

String in MQL4 is perfectly parsed in .Net byStringBuilderClass, so you're right that the string is not a memory location, but rather an object.

 
что из себя представляет массив строк в памяти? - что такое массив строк?! 

About the data structure STR.
I describe it from memory for MT5, the same should apply to MT4 too, probably, something will be different, but it should be close.


The line consists of Description + Data.
The Description contains the following fields:

buffer_len - buffer size allocated for string;
unicode_str pointer - pointer to unicode_str field (offset+8) in Data structure.

Data contains the following fields:
flags - set of flags describing string: static(0x03)/dynamic (0x01), possibly encodings...
len - string length;
unicode_str - unicode_str string directly pointed to by unicode_str pointer from Description.
 
Sergey Dzyublik:

About the data structure STR.
I describe it from memory for MT5, the same should apply to MT4 too, probably, something will be different, but it should be close.


The line consists of Description + Data.
The Description contains the following fields:

buffer_len - buffer size allocated for string;
unicode_str pointer - pointer to unicode_str field (offset+8) in Data structure.

The data contains the following fields:
flags - set of flags describing string: static(0x03)/dynamic (0x01), possibly encodings...
len - string length;
unicode_str - unicode_str string directly pointed to by unicode_str pointer from Description.

Question. Is it described somewhere or did you analyze it yourself?

 
Igor Makanu:

I want to return the string from .dll to MQL4 (MQL5 has no problems at all)

I've already made a lot of mistakes, so I need to ask the knowledgeable: What is an array of strings in memory? - What is an array of strings?

Pass only a uchar array instead of a string array. It's easier that way.
For example, you can convert like this:

int StringArrayToCharArray(string &stringArr[],uchar &c[]) {
   uchar temp[];
   int pos=0;
   for (int i=0; i<ArraySize(stringArr); i++) {
      ArrayFree(temp);
      StringToCharArray(stringArr[i],temp);
      ArrayCopy(c,temp,pos);
      pos+=ArraySize(temp);
   }
   return pos;
}
//+------------------------------------------------------------------+

int CharArrayToStringArray(string &stringArr[],uchar &c[]) {
   ArrayFree(stringArr);
   int pos=0;
   int j=0;
   for (; pos<ArraySize(c); j++) {
      ArrayResize(stringArr,j+1);
      stringArr[j]=CharArrayToString(c,pos);
      while(c[pos]!=0) pos++;
      pos++;
   }
   return j;
}

Works the same for MQL4 and MQL5