[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: varptr to structs returns bad pointer value


Le 04/03/2025 à 01:20, Jussi Lahtinen a écrit :

But if it is set "myData = New Struct", then will Gambas return an address to something that works like structure in C or Gambas object that works differently..?
IE is the pointer usable for external library anyway?

Jussi

As soon as you write "New <Structure datatype>", you create a Gambas object having the fields of the structure. So the address of this object is not the same as the address of its contents (as returned by 'Object.Data')

Excepted that case, a structure never exists on its own. It's always embedded in a Gambas object.

Regards,

--
Benoît Minisini.


References:
Re: varptr to structs returns bad pointer valueBenoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>
Re: varptr to structs returns bad pointer valueJussi Lahtinen <jussi.lahtinen@xxxxxxxxx>