我尝试使用 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/