Search code examples
c++windows-8winapi

Where's GetTickCount() in Windows 8 Consumer Preview?


I recently ported a very trivial app from Windows 8 Developer Preview to Windows 8 Consumer Preview. Everything seems to work fine except now the function GetTickCount() no longer seems to be defined in Windows.h or WinBase.h.

Despite the fact that I have these headers defined at the top of my file:

#include <Windows.h>
#include <WinBase.h>

My code line

unsigned int seed = GetTickCount() % UINT_MAX; 

still gives me the error:

error C3861: 'GetTickCount': identifier not found

Can anyone tell me where GetTickCount() went or what I should use as a replacement?


Solution

  • From the GetTickCount docs:

    Applies to: desktop apps only

    From the GetTickCount64 docs:

    Applies to: desktop apps | Metro style apps

    So, use GetTickCount64.