[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: varptr to structs returns bad pointer value
[Thread Prev] | [Thread Next]
- Subject: Re: varptr to structs returns bad pointer value
- From: vuott@xxxxxxxxxxxx
- Date: Tue, 4 Mar 2025 14:17:30 +0100 (CET)
- To: Jussi Lahtinen <jussi.lahtinen@xxxxxxxxx>
- Cc: User <user@xxxxxxxxxxxxxxxxxxxxxx>
In my opinion, Jussi, in these cases the best solution is the one you proposed: https://lists.gambas-basic.org/archive/user/2025-02/0000234.html 4 mar 2025, 01:20 da jussi.lahtinen@xxxxxxxxx: >> VarPtr() tries to return the memory address of where the value of a >> variable is stored. >> >> So when you write: >> >> dataSet = varptr(myData) >> >> you get the the address of where the value of 'mydata' is stored, not >> the address of the 'new MyStruct' object or the address of its contents. >> >> To get the address of a Gambas object contents, you must use the >> 'Object.Data()' static method on the object reference. >> >> dataSet = Object.Data(myData) >> > > 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 > >
Re: varptr to structs returns bad pointer value | Jussi Lahtinen <jussi.lahtinen@xxxxxxxxx> |
Re: varptr to structs returns bad pointer value | Benoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx> |
Re: varptr to structs returns bad pointer value | Jussi Lahtinen <jussi.lahtinen@xxxxxxxxx> |