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)); > Should we change the ListItem.Data property to > an integer or a cardinal? What does it store? > > See also http://www.freepascal.org/mantis/view.php?id=8647 > > TItemInfo = record // packing is not needed (and not wanted since it > controls also how this record is stored) > ImageIndex: Integer; > StateIndex: Integer; > OverlayIndex: Integer; > SubItemCount: Integer; > Data: Pointer; > //Caption: string[255]; // all stings follow here > end; > > Vincent > > _________________________________________________________________ > To unsubscribe: mail [EMAIL PROTECTED] with > "unsubscribe" as the Subject > archives at http://www.lazarus.freepascal.org/mailarchives _________________________________________________________________ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
