Hi,
I'd recommend using object handles instead.
At the moment, these aren't toooo elegant to use but their advantage is that you wont accidentally 'leak' objects - eg: if you convert an object to a byte ptr and there are NO references left to the object it may get accidentally 'flushed', resulting in really hard to find bugs.
You can perform object/handle conversions using functions, but it's a bit messy. For a kludge around until I clean this up...
I'd recommend using object handles instead.
At the moment, these aren't toooo elegant to use but their advantage is that you wont accidentally 'leak' objects - eg: if you convert an object to a byte ptr and there are NO references left to the object it may get accidentally 'flushed', resulting in really hard to find bugs.
You can perform object/handle conversions using functions, but it's a bit messy. For a kludge around until I clean this up...
Extern Function bbHandleToObject:Object( handle ) Function bbHandleFromObject:Int( obj:Object ) End Extern Type TMyType Field x=1 End Type Local obj:TMyType=New TMyType Local handle=bbHandleFromObject( obj ) obj=TMyType( bbHandleToObject( handle ) ) Print obj.x Release handle 'done with object!