OK, I understand. The terrible thing is that I saw using Tag as Pointer in
some delphi books.
That's implicate a lot of code with Tag as pointers. Maybe adding non
streamed TagPtr:PtrInt will be the best compromise?
Andrzej Kilijański
Dnia 16-10-2010 o 12:57:44 Michael Van Canneyt <[email protected]>
napisał(a):
On Sat, 16 Oct 2010, Hans-Peter Diettrich wrote:
And3mD schrieb:
I added bug report about using Tag as Pointers in IDE
http://bugs.freepascal.org/view.php?id=17642
For some reason (read-only???) I could not add a note there, so I'll
present my ideas here:
IMO Tag should become an int64 for all components, to overcome platform
and streaming problems. More properties can be introduced, for best
compatibility with existing code (Tag64, TagPtr). These properties
could be based on the same int64 field, i.e. r/w part of it, and only
that field is streamed. And when we just are extending the type, we
also could consider to make it big enough to hold a method reference...
Using tag as a pointer is plain wrong coding, so this change will not
make it.
Moreover, streaming it is pure nonsense: There is no guarantee that your
pointer
will point to the same object, or indeed whether it will exist at all
when the program is run.
The IDE code is simply wrong, and should be fixed properly by creating a
TMenuItem descendent that contains a reference to the notebook page, and
use that class when constructing the menu.
Michael.
--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus