本机C++传递 IIterable 到 WinRT
Native C++ passing IIterable to WinRT
我有一个使用WRL(Windows运行时模板库)访问WinRT API的Win32应用程序。
如何调用从本机C++获取IIterable
的函数?我的问题是获得实现IIterable
或IVector
的东西。
举个具体的例子,假设我想在 Include\10.0.14393.0\winrt\windows.ui.input.h 中调用SetDefaultMenuItems
:
namespace ABI {
namespace Windows {
namespace UI {
namespace Input {
MIDL_INTERFACE("A6B79ECB-6A52-4430-910C-56370A9D6B42")
IRadialControllerConfiguration : public IInspectable
{
public:
virtual HRESULT STDMETHODCALLTYPE SetDefaultMenuItems(
/* [in] */ __RPC__in_opt __FIIterable_1_Windows__CUI__CInput__CRadialControllerSystemMenuItemKind *buttons) = 0;
// ...
};
}
}
}
}
对于本机C++,似乎没有IIterable
或IVector
的库存实现。
我最终使用cppwinrt来做我想做的事情。有了这个,我能够将香草标准容器等传递给 WinRT。
相关文章:
- 是否可以用C++/WinRT将windows 10.0.14393作为目标
- 将 win32 hbitmap 转换为 winrt softwarebitmap
- 升级到 Windows 10 版本 1809 SDK 后,我无法编译使用 C++/WinRT 的项目
- 尝试从 XamlApplication 编译 C++/WinRT 空白应用程序时,我收到未解析的外部符号 winrt_make_*
- 在 Winrt/C++ 中使用应用服务
- 无法将运行时类绑定到 XAML T 必须是 WinRT 类型
- 是否可以从控制台应用程序使用 C++/WinRT 创建窗口?
- WinRT 应用调用 win32 c++ dll 发送参数
- 从 WinRT C++组件访问 COM 对象
- 使用 c++/WinRT Direct3D UWP Game DR 模板 Direct X11 的错误消息
- C++应用程序缺少 winrt::Windows::Storage::Streams::D ataWriter
- 我可以用C++/WinRT编写一个DLL,供windows桌面应用程序(而不是UWP)或Unity插件使用吗
- 如何在c++winrt中取消装箱多值字符串
- 在 c++ winrt 导航视图中,如何找到选择/单击的导航项?
- C++/WinRT,Windows SDK 17134的一部分与Visual Studio 15.8 Preview 3
- 如何从 c++ winrt UWP 应用中的代码将文本添加到富文本块
- C++/WinRT 数据 不正确的数据封送处理
- ERROR_ACCESS_DENIED在C++/WinRT中使用BluetoothLEAdvertisementWatc
- 无法在 WinRT 中获取异步操作结果 (Windows::Foundation::IAsyncOperating 接口
- 本机C++传递 IIterable 到 WinRT