Hi,
I'm getting an error while calling QueryPerformanceCounter and I don't know why.
The function returns FALSE, meaning it failed, but when I call GetLastError() it returns 0, meaning ERROR_SUCCES; there was no error...Code:LARGE_INTEGER start; BOOL bRet = QueryPerformanceCounter(&start); ASSERT(bRet); if(FALSE == bRet) { int nError = GetLastError(); PrintError(nError); }![]()
However If I do this, it works just fine:
LARGE_INTEGER looks like this:Code:LARGE_INTEGER* start = new LARGE_INTEGER; BOOL bRet = QueryPerformanceCounter(start); ASSERT(bRet); if(FALSE == bRet) { int nError = GetLastError(); PrintError(nError); } delete start;
I'm working on WinXP, with VC6.0, SP6, and have an AthlonXP 1600+.Code:typedef union union { struct { DWORD LowPart; LONG HighPart; }; LONGLONG QuadPart; } LARGE_INTEGER, *PLARGE_INTEGER;
Why is the first code failing (with 0 returned by GetErrorSucces) and the second one is just ok?
Thanks.




Marius Bancila
Reply With Quote