简体   繁体   English

在C ++或C ++ / CX中检测Windows Phone版本

[英]Detecting Windows Phone version in C++ or C++/CX

It seems that Windows Media Foundation works slightly different in Windows 8.1. Windows Media Foundation在Windows 8.1中的工作方式似乎略有不同。

And we need to add some code that looks like this: 我们需要添加一些类似于以下代码的代码:

#if WINDOWS_81
    DX::ThrowIfFailed(
        MFStartup(MF_VERSION)
        );
#endif

How can we check to see what version of Windows Phone is running via C++? 我们如何检查通过C ++运行的Windows Phone版本?

Thanks! 谢谢!

You can use WINVER to see / control which version the build is targeting at command time. 您可以使用WINVER在命令时查看/控制构建针对的版本。 See Using the Windows Headers . 请参阅使用Windows标头

// 0x0603 for Windows / Windows Phone 8.1
#if WINVER >= 0x0603
    DX::ThrowIfFailed(
        MFStartup(MF_VERSION)
        );
#endif

If the only reason is for the MFStartup check then you can leave out the conditional. 如果唯一原因是进行MFStartup检查,则可以不考虑条件。 It is required for 8.1, but it should work fine for 8.0. 8.1需要它,但是8.0应该可以正常工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM