命名空间“ winrt :: Windows :: Foundation :: EventRegistrationToken”没有成员“ EventRegistrationToken”

问题描述

我正在使用Windows SDK版本10.0.17763.0。基于https://docs.microsoft.com/en-us/uwp/api/windows.foundation.eventregistrationtoken,在10.0.10240中引入了EventRegistrationToken。因此,对于为什么尝试使用它时会出现错误,我感到困惑。我也没有在Windows.Foundation.h(10.0.17763)中定义它。

解决方法

Raymond Chan的评论就是答案:

:: EventRegistrationToken是ABI名称。 winrt :: event_token是 C ++ / WinRT名称。听起来好像您正在混合两者。

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...