Hi,
Is there a better way to use wxTreeListItemComparator with 64bit integers than modifying the types inside wxWidgets lib and rebuild it?
Thanks.
wxTreeListItemComparator with 64bit integers
Re: wxTreeListItemComparator with 64bit integers
Can't you just use a 64bit build? Or do you really need 64bit item-ids in a 32bit build?
Use the source, Luke!
Re: wxTreeListItemComparator with 64bit integers
I'm using 64bit build, but I would need to use 64bit integers in comparator which is only int, that's only 32bit.
virtual int Compare(wxTreeListCtrl* treelist, unsigned column, wxTreeListItem first, wxTreeListItem second) = 0;
virtual int Compare(wxTreeListCtrl* treelist, unsigned column, wxTreeListItem first, wxTreeListItem second) = 0;
Re: wxTreeListItemComparator with 64bit integers
That int is just the return value which can only be -1, 0,- 1. wxTreeListItem is a void* and therefore 64bit in a 64bit build.
Use the source, Luke!
Re: wxTreeListItemComparator with 64bit integers
Thank you!
Looks like it works, I copied the comprator from one wxWdigets sample which I don't remember anymore. The return value of comparator there wasn't limited to -1,0,1 - it was just: negative number, 0, positive number - in this case int64_t caused overflow to int return value. I limited the output to -1,0,1 and it works.
Looks like it works, I copied the comprator from one wxWdigets sample which I don't remember anymore. The return value of comparator there wasn't limited to -1,0,1 - it was just: negative number, 0, positive number - in this case int64_t caused overflow to int return value. I limited the output to -1,0,1 and it works.
Re: wxTreeListItemComparator with 64bit integers
Hi,
It would be interesting to try and build that sample and see if it (still) gives an assert.
Thank you
It would be interesting to try and build that sample and see if it (still) gives an assert.
Thank you
Re: wxTreeListItemComparator with 64bit integers
Hi,
Can you try that?
Thank you.
Can you try that?
Thank you.
Re: wxTreeListItemComparator with 64bit integers
I've tried it and it works. But I think based on @doublemax's reply, this should be reduced to 0, -1, 1 - in the sample. I posted a screenshot about this in former post, it's from VS debugger.