Skip to content
Prev 18736 / 63461 Next

external pointers

Hi Simon

Thanks for that... see below for my feeble counterblasts! (And two
questions.)
Very true, though 64 bit systems are not a big worry for Delphi 6.0
writers... ;) I did once speculate about hacking around this sort of
thing by encoding into character strings instead of integers, uggg.
Sorry, that was lack of clarity on my part about what I meant by
"persistent". Whenever I use this mechanism, I'm careful to ensure that
the C/Delphi objects only have lifetimes *within* a function, and to
include an 'on.exit' call to the "destructor"-- I would never  create
global objects pointing to ephemeral C structures. Admittedly, this
relies on programming self-discipline, and has no cast-iron anti-nirvana
mechanism! Ross' original query seems very much along these lines,
though.

If I was really creating global persistent objects, then 'externalptr'
would definitely be much better.

Where would be best to read about externalptr? I'm having trouble
finding material in the manuals or the site-search.

And would I need to use all the .Call machinery and C headers and SEXP
etc in order to handle externalptr objects?
bye
Mark