【发布时间】:2015-02-27 10:26:20
【问题描述】:
我正在尝试使用 c++ 代码获取 windows phone 8.1 的唯一 44 位设备 ID。我已经按照以下链接进行操作。
只有一行的短代码,
var UniqueID = Windows.Phone.System.Analytics.HostInformation.PublisherHostId;
但我遇到了很多错误。
error C3083: 'Analytics': the symbol to the left of a '::' must be a type ,
error C3083: 'HostInformation': the symbol to the left of a '::'must be a `type ,`
error C2039: 'PublisherHostId' : is not a member of'Windows::Phone::System' ,
error C2065: 'PublisherHostId' : undeclared identifier
我还定义了ID_CAP_IDENTIY_DEVICE属性,这里就是这样提到的。
<Capability Name="ID_CAP_IDENTITY_DEVICE"/>
虽然我很困惑这是对还是错。
【问题讨论】:
-
您确定要构建 Windows Phone 8.0 C++?这对我来说编译得很好:
auto x = Windows::Phone::System::Analytics::HostInformation::PublisherHostId; -
对不起!它是 Windows Phone 8.1,是的,我正在用 C++ 做。
-
好的,请更新标题和标签然后:-)
标签: c++ windows-phone-8.1 uniqueidentifier win-universal-app