B4R Question how to store pointer from wrapper in B4R ?

candide

Active Member
Licensed User
it is a question without answer for me : how to store a pointer provided by wrapper in B4R ?

what is the need : in several interesting libraries, objects are created and managed by pointer

adaptation of this type of library to B4R is blocked...



in library, if we have also an index by object, we can manage each object in B4R by index and conversion to pointer is done in wrapper.

in others case,
- in wrapper interface, we can convert a pointer to "object" B4R
but an object is stored on the stack and cannot be stored in a global variable (or i didn't find the way to do it).
=> if we have a callback from wrapper with pointer, if wrapper make a conversion to "object" to B4R, i cannot compare it with pointer found in an other sub...

- in wrapper interface, we can convert in a "long" by a "reinterpret_cast<uint32_t>(pointer)
=> in this case i can store pointer in a "long" global variable at creation and i can compare when a callback is coming
this case is working, but this convertion is not clean .....

do we have more options with current version of B4R ?

an idea will be welcome
 
Last edited:

candide

Active Member
Licensed User
yes, in B4R, an Object type = BR_PTR is lost when method ends

do we have a way to store pointer in this Object before end of method ? Or Can we convert this pointer to Ulong by example ?

or what we can do in B4R with an Object type = BR_PTR ?
 
Upvote 0
Top