Array references - page 2

 
sergeev:

Well, did you get

No, it's not going to work.

To get what I want, I need to know the full structure of the array and have a pointer to the beginning of the structure.

You can try it, of course... But that's a hack). Although in general... Yes, I'll have to try it )

 

what is "full structure"?

its size? or the type of data?

Документация по MQL5: Основы языка / Типы данных
Документация по MQL5: Основы языка / Типы данных
  • www.mql5.com
Основы языка / Типы данных - Документация по MQL5
 
sergeev:

what is "full structure"?

In short, it won't work.
 
where is the problem?
 
sergeev:
Could you elaborate on where the problem is?

Well for example -- when you pass an array of strings to the dll, you don't pass a pointer to a null-string, but a structure with a pointer.

So for arrays, I don't see a way to get to the structure itself. There is only a pointer to the array data itself.

Ok, one more idea came up though )

 
TheXpert:

Well for example -- when you pass an array of strings to the dll, you don't pass a pointer to a null-string, but a structure with a pointer.

So for arrays, I don't see a way to get to the structure itself. There is only a pointer to the array data itself.

Wrap the array with a structure, then you can get to it. The additional memory consumption == 0.
 
MetaDriver:
Wrap the array with a structure, then you can get to it.
And how do you get a pointer to a structure? I was about to do almost the same thing, but with one extra plus.
 
TheXpert:
How do you get a pointer to a structure? I wanted to do almost the same thing, but with one more extra tidbit.
memcpy():)
 
MetaDriver:
memcpy() :)

OK, I'll have to try it tonight.

Because the links don't work, the files don't work ( . I've got to get something at least.

 
Structures with dynamic arrays cannot be passed in this way.
Документация по MQL5: Основы языка / Типы данных / Объект динамического массива
Документация по MQL5: Основы языка / Типы данных / Объект динамического массива
  • www.mql5.com
Основы языка / Типы данных / Объект динамического массива - Документация по MQL5