Windows 8 Consumer Preview中的GetTickCount()在哪里?

问题描述 投票:3回答:1

我最近将一个非常琐碎的应用程序从Windows 8 Developer Preview移植到Windows 8 Consumer Preview。除了now函数GetTickCount()似乎不再在Windows.h或WinBase.h中定义之外,一切似乎都正常工作。

尽管我在文件顶部定义了这些标题:

GetTickCount()

我的代码行

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

仍然给我错误:

unsigned int seed = GetTickCount() % UINT_MAX; 

[谁能告诉我error C3861: 'GetTickCount': identifier not found 到哪里去了,或者我应该用什么代替?

c++ windows-8 winapi
1个回答
13
投票

GetTickCount()

仅适用于:桌面应用程序

GetTickCount docs

适用于:桌面应用| Metro风格的应用]

因此,请使用GetTickCount

© www.soinside.com 2019 - 2024. All rights reserved.