A
Alain Dekker
I know how to privately declare a function exported from kernel32.dll as
follows:
Private Declare Function GetTickCount Lib "kernel32 as Long
and then to use code like this:
Dim lElapsed as Long
lElapsed = (GetTickCount() - lPreviousTimeValue)
' etc
but I'm curious. Why is the type Long? The VB.NET (2003.NET) documentation
tells me that a Long is a 64-bit signed number. In my experience of all
previous compilers (Delphi 7, Visual C++, etc), I'ce always known
GetTickCount() to return a DWORD (unsigned 32-bit number).
In fact, the MSDN documentation states that:
DWORD WINAPI GetTickCount(void);
http://msdn.microsoft.com/en-us/library/ms724408(VS.85).aspx
Why does VB return a signed 64-bit number? Why doesn't VB have a unsigned
32-bit integer data type anyway? Its got a 8-bit and 16-bit unsigned type,
but no 32-bit unsigned.
Also, what are the units of the VB GetTickCount version? Again, in all
previous compilers it was in ms, is that still the case?
Thanks,
Alain
follows:
Private Declare Function GetTickCount Lib "kernel32 as Long
and then to use code like this:
Dim lElapsed as Long
lElapsed = (GetTickCount() - lPreviousTimeValue)
' etc
but I'm curious. Why is the type Long? The VB.NET (2003.NET) documentation
tells me that a Long is a 64-bit signed number. In my experience of all
previous compilers (Delphi 7, Visual C++, etc), I'ce always known
GetTickCount() to return a DWORD (unsigned 32-bit number).
In fact, the MSDN documentation states that:
DWORD WINAPI GetTickCount(void);
http://msdn.microsoft.com/en-us/library/ms724408(VS.85).aspx
Why does VB return a signed 64-bit number? Why doesn't VB have a unsigned
32-bit integer data type anyway? Its got a 8-bit and 16-bit unsigned type,
but no 32-bit unsigned.
Also, what are the units of the VB GetTickCount version? Again, in all
previous compilers it was in ms, is that still the case?
Thanks,
Alain