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

Re: varptr to structs returns bad pointer value


He should try:Private Extern myFunction(data As Pointer) In "mylib"Public Struct myStruct    result As Long    msg As StringEnd StructPrivate myData As Struct MystructPublic Sub doit2()    myFunction(VarPtr(myData))  End
----------------------------------------------------------------------------------





2 mar 2025, 22:43 da jussi.lahtinen@xxxxxxxxx:

>>
>>
>> No this does not pass the correct pointer, I am trying to pass a      generic structure, I want to use pointers.
>>
>>
> I see, it wasn't clear from the example code you gave.  I agree with your implementation plan.
>  
>
>>
>> I am sorry but varptr(xxx)    should return a pointer to the      actual memory containing the structure.
>>
>>
> I agree, but this isn't in the documentation and it seems it is not implemented [cannot find it under void SUBR_varptr(ushort code)
> ]. For the reasons Benoit knows, this is not raising error either. I don't know enough about the implementation details to say more.
> Maybe this can be added.
>
> Jussi
>  
>


Follow-Ups:
Re: varptr to structs returns bad pointer valueJussi Lahtinen <jussi.lahtinen@xxxxxxxxx>
References:
Re: varptr to structs returns bad pointer valueBrian G <brian@xxxxxxxxxxxxxxxx>
Re: varptr to structs returns bad pointer valueJussi Lahtinen <jussi.lahtinen@xxxxxxxxx>