[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: Brian G <brian@xxxxxxxxxxxxxxxx>
- Date: Sat, 1 Mar 2025 15:48:29 -0800
- To: user@xxxxxxxxxxxxxxxxxxxxxx
No this does not pass the correct pointer, I am trying to pass a generic structure, I want to use pointers.
I am sorry but varptr(xxx) should return a pointer to the actual memory containing the structure.
I don't want to create 10 or fifteen extern descriptions one for each type of structure that can be passed. Trying to create unique names and that seems silly.
The structures contains a key in the first field that identifies them to the interface.
Why is the varptr not returning the correct pointer?My work around is to do the alloc and assign for now...... but it does not seem right.
On 2/27/25 14:44, Jussi Lahtinen wrote:
And I think this should be: extern myFunction(data as myStruct) use "mylib" JussiOn Fri, Feb 28, 2025 at 12:27 AM Jussi Lahtinen <jussi.lahtinen@xxxxxxxxx> wrote:public sub doit2() mydata = new myStruct dataSet = varptr(myData) myFunction(dataSet) ' this fails invalid pointer provided end sub Try: public sub doit2() mydata = new myStruct myFunction(mydata) end sub Jussi
-- ~~~~ Brian
Attachment:
OpenPGP_0x78BFB26402F48419.asc
Description: OpenPGP public key
Attachment:
OpenPGP_signature.asc
Description: OpenPGP digital signature
Re: varptr to structs returns bad pointer value | Jussi Lahtinen <jussi.lahtinen@xxxxxxxxx> |