HandleFromObject - HandleToObject ?

BlitzMax Forums/BlitzMax Programming/HandleFromObject - HandleToObject ?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

According to Brucey this should work:
Local a:mytype = New mytype
Local b:Byte Ptr = Varptr(a)

Local obj:mytype = mytype(HandleToObject(Int(b))) '< Brucey!
obj.Say()


But it doesn't :( ("Unhandled Memory Exception Error" - when it tries to call obj.Say(), because obj is Null)