On Wed, 28 May 1997 15:46:06 -0400 (EDT) Pierre Phaneuf pp@dilu.ml.org wrote:
On Wed, 28 May 1997, The African Chief wrote:
[...]
Maybe the InstanceFromSelfID is valid (though I'd simply use the instance pointer as a handle), but (in a Turbo Vision context) only TView should have a Handle, because it is the first class that can possibly have a window handle. The InstanceFromHandle would hence return a PView or a PWindow, which is much more useful, since TView/TWindow has methods for window manipulation that TObject doesn't even have.
Yes, that is correct. The handle is not not necessary in TObject - but I still feel that it does no harm to have it there.
It has a present use - to be able to locate every object instance by its own unique ID. See above.
The instance pointer is an unique ID, why have another redundant one?
Yes, the instance pointer is a unique ID. But this assumes that you know the instance pointer. This will be the case in most situations, but it won't always be the case. And, like I said in another post, there are things that you can do with integers that you cannot do with pointers.
Best regards, The Chief Dr Abimbola A. Olowofoyeku (The African Chief, and the Great Elephant) Author of: Chief's Installer Pro v3.50 for Win16 and Win32. Homepage: http://ourworld.compuserve.com/homepages/African_Chief/ E-mail: laa12@cc.keele.ac.uk
On Thu, 29 May 1997, The African Chief wrote:
Maybe the InstanceFromSelfID is valid (though I'd simply use the instance pointer as a handle), but (in a Turbo Vision context) only TView should have a Handle, because it is the first class that can possibly have a window handle. The InstanceFromHandle would hence return a PView or a PWindow, which is much more useful, since TView/TWindow has methods for window manipulation that TObject doesn't even have.
Yes, that is correct. The handle is not not necessary in TObject - but I still feel that it does no harm to have it there.
What if it did? What if I use a windowing system that has long integers for window handles? You have a field there that's basically of *no use*.
The instance pointer is an unique ID, why have another redundant one?
Yes, the instance pointer is a unique ID. But this assumes that you know the instance pointer. This will be the case in most situations, but it won't always be the case. And, like I said in another post, there are things that you can do with integers that you cannot do with pointers.
I don't know. Why would you know more the integer ID than the instance pointer? And what kind of things would you do with an unique integer ID?
Pierre Phaneuf
"The use of COBOL cripples the mind; its teaching should, therefore, be regarded as a criminal offense." - Edsger W. Dijkstra.