Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EIntOverflow #2

Open
jcplu opened this issue Feb 19, 2022 · 4 comments
Open

EIntOverflow #2

jcplu opened this issue Feb 19, 2022 · 4 comments

Comments

@jcplu
Copy link

jcplu commented Feb 19, 2022

Hello,
I sometimes get EIntOverflow with
function TTreeNodeHelper.GetCheckState: TCheckState;
because State = 0, so Result = -1

An idea ?

@wlandgraf
Copy link
Contributor

Do you have steps to reproduce the issue in a consistent way?

@jcplu
Copy link
Author

jcplu commented Feb 19, 2022

I think that StateIndex and CheckState are not synchronized so I need to initialize StateIndex and CheckState.

@jcplu
Copy link
Author

jcplu commented Feb 19, 2022

TreeView_SetItemState(TreeView.Handle, Self.ItemId, State, TVIS_STATEIMAGEMASK) returns value > 0
TreeView_GetItemState(TreeView.Handle, Self.ItemId, TVIS_STATEIMAGEMASK) returns value = 0

@jcplu
Copy link
Author

jcplu commented Feb 19, 2022

wNode.CheckState := csUnchecked;
wNode.StateIndex := 0;
KO

wNode.StateIndex := 0;
wNode.CheckState := csUnchecked;
OK

It seems that StateIndex assignation changes the value of CheckState.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants