Pass a two-dimensional array from MQL4 to dll - page 3

 
TheXpert:
There are no multidimensional arrays in MQL4. Transmit it as a one-dimensional one. The main thing is to correctly calculate the size and transmit it.

int ArrayResize( object&array[], int new_size)
Sets the new size in the first dimension of the array. If executed successfully, the function returns the number of all elements contained in the array after resizing, otherwise it returns -1 and the array does not resize.
Note: an array declared locally in any function that has been resized will remain unchanged upon function completion. When the function is called again, such an array will have a different size than the declared size.
Parameters:
array[] - Array for resizing.
new_size - New size for the first dimension.
Example:
double array1[][4]; int element_count=ArrayResize(array1, 20); // new size - 80 elements


This is a quote from the help and a simultaneous response to the author of the post about all arrays in MQL being one dimensional.

 
Debugger:

This is a quote from the help and a simultaneous answer to the author of the post about how all arrays in MQL are one-dimensional.

This is a function on top of a one-dimensional array. Try to prove otherwise.
 
Why reinvent the wheel and try to appear smarter than the C++ developers?
 
Debugger:
Why reinvent the wheel and try to appear smarter than the C++ developers?

What we think and what is actually there are O-O-O often DIFFERENT things, and even more so when we try to think for others!

Do you really think Vadim has nothing better to do than "seem smarter than the developers"? Do you know the man so well to fantasize like that?! I'd be scared to live in a world distorted to that extent... :)))

And if a person changes/modifies/redesigns something which was earlier created by somebody else - that's his right! It's NORMAL to change the world for oneself although it's against the accepted "to bend to the changing world"... ;)

 

I wonder where such a "bike" lies? :-))

Before writing, I dug through everything. Not even in Boost. Not to mention C++, which has nothing to do with it, and there's no such thing in STL either.

By the way, there is no complete solution to this problem. I won't go into details, but C++'s capabilities are insufficient to solve this problem.

I consulted on Windgrad. There are some good programmers there. As soon as they learned the task, they immediately predicted some specific problems. Of course, I solved almost all of them. There remained unsolvable ones, in principle. These are problems related to handling array contents through the indexing operators "[]". No one on the Internet knows how to do it. I have made a crutch. Now we can almost fully work with "[]" operators but we have to supply a certain index type to the last dimension (which we can easily forget to do and the compiler won't warn us about). Then it works like a usual multidimensional array with indexing through []. That is, the operator is overloaded 4 times with a different index type. One overloading returns the cell contents by the last linear index calculation by the previous [] operators. The other overloads return an object so that the [] operator can be used again. In some cases a type cast operator is triggered which returns the contents of the cell last accessed. In some cases this does not work. There may be some problems which you will learn about only after the program fails to work correctly. In some cases the compiler helps. In others, it's the exceptions that put in place for possible user errors. I have tried to provide for all cases.

The main problems are these:

a[0][1][2] = a[0][1][3] + a[0][5][2] / a[0][8][12]; // Здесь на всякий случай надо в последнем измерении использовать тип _SIZE_T. Для логических операций тоже надо.

There is the at() method. It fully and completely replaces operators "[]".

The class is protected by critical section to work in multithreaded applications.

 
Zhunko:

No, it's beyond me, I can't read it silently.

You're a nub cyclist. The simplest implementation was posted not too long ago in mql5 (!) with a line size of 100 lines.

 
TheXpert:

No, it's beyond me, I can't read it silently.

You're a nub cyclist. The simplest implementation was posted not too long ago in mql5 (!) with a line size of 100 lines.

It's rubbish out there.
 
Zhunko:
That's bullshit.

Oh yes, no bullshit only from the great guru Vadim, kneel before his countenance.

Ugh... Underachievers have the biggest ego. They've learned to use msdn and help, they've written over 1000 lines of text and that's it, I'm a star. I heard somewhere the word singleton and XP, that's it, I know programming patterns and methods. I'm a fucking designer...

You should be ashamed of yourself, you're not a boy.

 
Vadim! Are you interested in wasting your time on THIS ("you're a fool yourself") level of argumentationby"self-defeating" people???
 
TheXpert:

Oh yes, no bullshit only from the great guru Vadim, kneel before his countenance.

Ugh... Underachievers have the biggest ego. They've learned to use msdn and help, they've written over 1000 lines of text and that's it, I'm a star. I heard somewhere the word singleton and XP, that's it, I know programming patterns and methods. I'm a fucking designer...

You should be ashamed of yourself, you're not a boy.


Andrew, why didn't you show me what a super-programmer you are? The first step is to explain how you solved the problem. I wrote how I solved it. Now you tell me. Then we'll look into your misconceptions together.

Once again, I'm not a programmer. I'm better than that.

===========

By the way, I don't have projects of less than 1000 lines. Usually dozens of times more. This class (base) is 5110 lines + 2 2500 lines each of class inherited from it. That's not counting a dozen of similar ones used in the project.