尝试关闭 DesktopWindowXamlSource 时引发的异常
Exception thrown when attemping to close DesktopWindowXamlSource
本文关键字:异常 DesktopWindowXamlSource 更新时间:2023-10-16
我正在为我的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();
但调试器的输出窗口指示正在引发异常:windowsadvcorewinrtiwindowcorewindowdesktopdesktopwindowcontentbridge.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.
我做错了什么?
您是否展示了您的应用程序?
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">unaware</dpiAwareness>
</windowsSettings>
</application>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<maxversiontested Id="10.0.18362.0"/>
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
</application>
</compatibility>
</assembly>
从我的文章。
相关文章:
- 处理多个异常集合的C++方法
- 我在c++代码中生成了一个运行时#3异常
- 孤立代码块在结构中引发异常
- C++中的赋值发生,尽管右侧出现异常
- 从构造函数抛出异常时如何克服内存泄漏
- 异常属于C++中的线程还是进程
- 当类定义不可见时捕获异常
- 引发异常:读取访问冲突**dynamicArray**为0x1118235.发生
- 为什么异常不退出程序?
- 为什么我应该在异常处理中使用std::cerr而不是std::cout
- 如何修复链表类实现的未处理异常0xDDDDDDDD
- 关于:C++中异常对象的范围:为什么我没有得到副本?
- 是什么导致了Unity 3D中的"错误线程异常"?
- 如何将strftime中的格式错误作为异常捕获
- 创建具有 new in 函数和"this is nullptr"异常的对象
- 尝试使用智能指针时引发异常
- 函数如何通知用户它基于函数原型抛出异常?
- 是否值得降低我的代码的可读性,以便在出现内存不足错误时提供异常安全性?
- 当我使用 C++ 中的 C# dll 来使用 Selenium 时,存在异常处理问题
- Pytorch torch.cholesky忽略异常