Over the weekend, I uploaded about 50 new seamless 2D cartoon-style texture images. They live on these pages:
TXR - ABSTRACT - Cartoon
TXR - BRICK - Cartoon
TXR - METAL - Cartoon
TXR - ROCK/STONE - Cartoon
TXR - WOOD - Cartoon
More new music tracks are coming out on Wednesday.
Have a good week!
it’s less work than keeping track of resets, but yea, i believe you can do it that way if you wanted, it’ll just require a tiny bit more processing power
EDIT: Your method’s benefit is support for Windows XP and below. Windows XP and below does not have the GetTickCount64 method so it’ll just crash on there(if you’re worried about WindowXP and below support that is)
Ahh, I gotcha now.
You should also be able to keep track of the number of resets GetTickCount has gone through, then do a bit of math with it:GetTick = GetTickCount + ((MAX_LONG * 2) * TickResetCount) + TickResetCount
This is a bit more math, but it does mean you’re able to use the Currency type. However, because VB6 has problems with math and overflows, you have to convert the max long to use a currency type, and that has to use &H7FFFFFFF as the value since numbers give an error.
I’m going to assume your way is faster/better to use.
GetTickCount returns a DWORD-based value, which is essentially VB6’s Long datatype, but still larger since a Dword is an unsigned int. because you can’t actually GET an unsigned value in VB6(without some extra maths that i can’t think of right now), it’s going to overlap regardless of what datatype you use. sure, you could probably divide the Tick count by some value and keep going, but eventually you’re still going to hit the limit of Long(or in this case, GetTickCount in general), and overlap into the negatives.
What my code does is get rid of that overlap entirely. Single and Double go nowhere near what the Currency datatype can go to, that and it can actually hold the value that GetTickCount64 provides.
GetTickCount will overlap regardless of what you do. GetTickCount64 just holds a LOT larger of a value to prevent this
Couldn’t you just use a Single or Double with GetTickCount? Or does the floating point mess up the value or something?
There are various ways of fixing this issue, essentially GetTickCount will overlap into the negatives after a certain amount of time has passed(i can’t remember the exact amount of days, but Long is 2.14 billion, and that goes by within like, i believe a week or 2)
There’s also timeGetTime, which will get you a longer duration before the value is overlapped to a negative(47 days).
But, there’s an even better solution. You’d be losing out on support for Windows XP however as Windows XP does not have support for it.
GetTickCount64. this uses the Currency data type in vb6(ULongLong in C++, ULong in .net), it has a max of 9,223,372,036,854,775,807. which lasts for years.
to use this, simply doPublic Declare Function GetTickCount64 Lib "kernel32" () As Currency Function getTick() As Currency getTick = GetTickCount64 * 10000 End Function
Essentially what this does is, return the value from getTickCount64 * 10000. why the multiplication? the value that is received from GetTickCount64 is a floating point value(a LOT smaller than getTickCount), however, if you mutliply by 10k, it returns a solid value, which is what we need.
You CAN use something like a long at this point, but you’ll be getting the same issue again with the rolling over to the negative values.
This essentially solves the issue of trying to handle the rolling over issue, in a few lines of code.
As i said however, you lose the ability to use any program with this code, on Windows XP as WinXP does not have support for it.
Hope this helps!