我正在为我的 Win32 C++ 应用程序使用 UWP Xaml 托管 API。我有以下代码:
winrt::Windows::UI::Xaml::Hosting::WindowsXamlManager XamlManager = winrt::Windows::UI::Xaml::Hosting::
WindowsXamlManager::InitializeForCurrentThread();
winrt::Windows::UI::Xaml::Hosting::DesktopWindowXamlSource XamlSource;
当我完成 UWP 内容时,我正在打电话
XamlSource.Close();
XamlManager.Close();
但是调试器的输出窗口表明正在抛出异常:
windows\advcore\winrt\iwindow\corewindow\desktop\desktopwindowcontentbridge.cpp(499)\Windows.UI.dll!00007FFD91CD860F: (caller: 00007FFD91CD7704) ReturnHr(1) tid(7168) 8007139F The group or resource is not in the correct state to perform the requested operation.
我究竟做错了什么?