Montfrooij
Captain
Flight distance : 2560453 ft
Netherlands
Offline
|
It was caused by lack of understanding the logic behind a function.
I assumed that a messagebox would block the code.
And it did.
But other events could still be fired and start a new thread.
Which lead to odd behavior (user having to react to some question while the scale was still passing on weights)
I made a simple test program that had a trigger on a barcode scanner read and a messagebox and it was very clear that my assumption was wrong.
So I searched for a way to block events from being fired 'if' but that turned out to be harder than I hoped and while I was looking for a solution, it became clear that you don't 'always' want this.
So I opted for the manual way and added a global variable that I can react on in the method that is called after the event was triggered.
It is manual, since you have to add this in every method that you think it is needed, but that is what I ended up using.
There will be better ways maybe, but I can at least now stop this problem from occurring (so I hope) |
|