我有运行时组件项目(通用)中的程序来获取应用程序ID,
Platform::Guid MyClass::getAppId()
{
#ifdef WINAPI_PARTITION_PHONE_APP
return Windows::ApplicationModel::Store::CurrentApp::AppId;
#endif
}
在此之后,我创建了一个Windows8.1应用程序并调用该函数,它应该会出现错误,因为我希望windows只返回数据,但是它通过了编译,我尝试使用winapifamily.h
中的其他宏,但都失败了。
那么,如何区分Windows8.1和Windows应用程序的目标平台呢?
发布于 2016-01-12 14:46:17
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
// This code is for Win32 desktop apps
#else
// This code is for WinRT Windows Store apps
#endif
#if defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
// This code is for Windows phone 8
#endif
https://stackoverflow.com/questions/34724476
复制相似问题