c++ - WinRT WRL ABI 集合

标签 c++ collections windows-runtime wrl

我尝试使用 WRL 并坚持使用集合。

我需要传递函数附加属性:

ABI::Windows::Devices::Enumeration::IDeviceInformationStatics::FindAllAsyncAqsFilterAndAdditionalProperties(
  /* [in] */ __RPC__in HSTRING aqsFilter,
  /* [in] */ __RPC__in_opt ABI::Windows::Foundation::Collections::IIterable<HSTRING>* additionalProperties, ...)

但是 IIterable 没有方法来填充它,并且与 IVector<T> 没有任何联系。 (它有填充方法,但它是抽象接口(interface))。

我需要像 there 那样实现自己的 vector 吗?还是存在更简单的方法来处理集合?什么样的集合在这些接口(interface)下返回ABI函数?

最佳答案

您需要实现自己的(或重复使用您发布的链接中的那些)。

请注意,IIterable 确实有一个方法“First”,如果您想自己实现,可以实现它。查看 windows.foundation.collections.h 了解更多详细信息。

关于c++ - WinRT WRL ABI 集合,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34577285/

相关文章:

c++ - 无法在列表 vector 中使用列表

.net - 是否需要封装Collections?

scala - 获取 Scala 中 List[Option] 中具有值的所有条目

java - 通过哈希比较 java 映射

javascript - 您的 project.json 未将 'win10' 列为目标运行时

c++ - 使用宏计算源文件行数?

c++ - Char * 指针初始化

c++ - 为什么即使在从 int 类型转换为 double 之后,小数部分也没有小数?

c# - 如何在 WinRt App 中将 WriteableBitmap 图像转换为字节数组

windows-8 - WinRT/Win8 Metro 中的 XAML 基元