Florian Klaempfl schreef:
Vincent Snijders schrieb:
Hi,

The listview example doesn't run on 64 bit computers. This is caused by
the fact that the listview example contains listview items. Those items
are streamed by reading/writing a TItemInfo record for each item with
the following code:
      Stream.ReadBuffer(ItemInfo, SizeOf(ItemInfo));

Because TItemInfo contains a pointer, the size of TItemInfo is not the
same on 32 bits platforms as on 64 bits platforms. The example is stored
with a TItemInfo with a 4 bytes data field, the 64 bits lazarus version
reads a 8 byte field and in the end more data will be read then there is
available.

How can this be solved?

Steaming data seems useless to me? So stream only the first four
elements one by one?

Stream.ReadBuffer(ItemInfo.ImageIndex, SizeOf(ItemInfo.ImageIndex));
...
Stream.ReadBuffer(ItemInfo.SubItemCount, SizeOf(ItemInfo.SubItemCount));


That is another option.

Should we change the ListItem.Data property to
an integer or a cardinal?

What does it store?


Whatever the user puts into it. I guess it is similar to TComponent.Tag.

Vincent

_________________________________________________________________
    To unsubscribe: mail [EMAIL PROTECTED] with
               "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to