base中的例外。H当我运行Winui 3桌面项目时
当我运行 winui 3、c++/winrt 项目时,出现一些奇怪的异常。我得到其中三个,我可以按 f5 在调试模式下继续,并且我的代码正常运行,但我不能。问题是我不知道我的代码的哪一部分导致了它。例外情况位于 base.h 文件中。我无法找到任何可能导致它们的原因。以下是复制的异常:
Sentinel3.exe 中 0x00007FFCF3784F69 处未处理的异常:Microsoft C++ 异常:内存位置 0x00000068E818E688 处的 winrt::hresult_wrong_thread。
当 base.h 文件中的 result == impl::error_not_implemented 时,调试器中会弹出上述异常。根据我在网上发现的内容,这意味着 Hresult 抛出 E_NOTIMPL HRESULT 错误,这意味着某些内容未正确实现,但我不知道那是什么。
Sentinel3.exe 中的 0x00007FFCF3784F69 处抛出异常:Microsoft C++ 异常:内存位置 0x00000068E818E8C8 处的 winrt::hresult_error。
在 base.h 文件中的 [[noreturn]] 内联 WINRT_IMPL_NOINLINE void throw_hresult(hresult const result) 函数之后,上面的异常在调试器中弹出
Sentinel3.exe 中 0x00007FFCF3784F69 处未处理的异常: Microsoft C++ 异常:内存中的 winrt::hresult_error地点0x00000068E818E8C8。
在base.h文件中的[[noreturn]]内联WINRT_IMPL_NOINLINE void throw_hresult(hresult const result)函数编辑::之后,上面的异常也在调试器中弹出,
所以我发现我需要更新调试器中的一些内容以实现可视化studio,现在知道问题是“- 结果 RPC_E_WRONG_THREAD 应用程序调用了为不同线程编组的接口。 winrt::hresult" 我仍然不确定代码的哪一部分导致了问题,我认为这与更新 MainWindow.xaml.cpp 文件中的 UI 有关,但我不确定是哪一部分导致了问题。我在网上找到了一些关于使用 adispatcher.invoke() 函数之类的东西来更新 UI 的内容,但它似乎只在 c# 中可用,或者至少我找不到 c++ 的示例。
I get some strange exceptions when I run my winui 3, c++/winrt project. I get three of them that I can press f5 to continue through in debug mode and my code runs as normal, but I can not. The issue is that I do not know what part of my code is causing it. The exceptions are in the base.h file. I have not been able to find anything about what may be causing them. Here is the copied exceptions:
Unhandled exception at 0x00007FFCF3784F69 in Sentinel3.exe: Microsoft C++ exception: winrt::hresult_wrong_thread at memory location 0x00000068E818E688.
The exception above popped up in the debugger when result == impl::error_not_implemented in the base.h file. From what I found online that means that the Hresult is throwing a E_NOTIMPL HRESULT error meaning something is not implemented correctly but I cannot tell what that is.
Exception thrown at 0x00007FFCF3784F69 in Sentinel3.exe: Microsoft C++ exception: winrt::hresult_error at memory location 0x00000068E818E8C8.
This exception above popped up in the debugger after the [[noreturn]] inline WINRT_IMPL_NOINLINE void throw_hresult(hresult const result) function in the base.h file
Unhandled exception at 0x00007FFCF3784F69 in Sentinel3.exe: Microsoft C++ exception: winrt::hresult_error at memory location 0x00000068E818E8C8.
This exception above also popped up in the debugger after the [[noreturn]] inline WINRT_IMPL_NOINLINE void throw_hresult(hresult const result) function in the base.h file
Edit:: So I figured out that I needed to update something in the debugger for visual studio, and now know that the problem is "- result RPC_E_WRONG_THREAD The application called an interface that was marshalled for a different thread. winrt::hresult" I am still not sure what part of my code is causing the problem, I assume it is something to do with updating the UI within the MainWindow.xaml.cpp file, but I am not sure what part is causing it. I found some stuff online about using something like adispatcher.invoke() function to update the UI but it seems to only be available in c# or at least I could not find an example of it with c++.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论