Hello everybody.
I have a problem with GetTickCount64 that never occurred.
I use it to assign a unique name to panels created at runtime, eg MyPanel + [GetTickCount.ToString].
I don't go into the details of my application because I don't think it's necessary but in general:
I have some figures on the screen and each of them is associated with some panels contained in a TScrollBox (which shows only the panels associated with the selected figure).
When I double click on a figure, I delete the contents of the TScrollBox and recreate the panels associated with that figure (whose data is saved on a text file).
I load the contents of the file into a TStringList and use a for loop to recreate the panels.
What happens is that GetTickCount always returns me the same value and therefore I am raised an exception in creating the second panel (duplicate name).
But if I write something like this:
n:=(GetTickCount64-random(1000)).ToString;
MyPanel.Name:='Panel'+n;
the problem seems to be solved.
So it would appear that GetTickCount64 doesn't change value as opposed to random (1000) which returns a different number.
Do you have any ideas? Is there any way to somehow reset GetTickCount64?
[edit]
I think the only explanation is that less than a millisecond passes between each pass of the loop.