I forgot to mention that I'm doing this in a multi-thread MDI application. I cannot post it here, it has more than 200,000 code lines and it ain't worth to isolate just that part.
I tried to create another simple (MDI) application, put there the code and it works beautiful. So, it makes me wonder even more...
Last edited by cilu; September 6th, 2004 at 10:13 AM.
cilu, are you sure that problem is in multithreading? AFAIR QueryPerformanceCounter() is thread-safe function, so may be there are another circumstances?
I didn't say that the problem is multi-threading, I just wanted to give as much details as possible. The code posted is taken from a member function of a CDocument derived class.
The function returns FALSE, meaning it failed, but when I call GetLastError() it returns 0, meaning ERROR_SUCCES; there was no error...
I just had the same problem but I notice something else:
- If the variable is a member of the class: The function fails.
- If the variable is a pointer (allocated with a new): The function works.
- If the variable is local (on the stack): The function works.
Bookmarks