On 1 sep 2006, at 19:54, Felipe Monteiro de Carvalho wrote:
I have a function that will receive a Handle. That handle could be a pointer to a structure, or a object. Is there any safe way to discover it's nature?
No, if only because there is no generic way to distinguish a random record which just looks like an object (because it happens to contain the right bytes at the right place) and a genuine object (or anything else for that matter).
The only way would be to make sure all objects are allocated from a separate memory pool, and checking whether the passed address lies in this pool.
Jonas _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal