你好,
欢迎来到 Microsoft Q&A!
我建议您可以忽略该异常:Debug -> Windows -> Exception Settings,C++ Exception,然后取消选中winrt::hresult_error。
如果答案是正确的解决方案,请单击“接受答案”并请投赞成票。如果您对此答案有其他疑问,请点击“评论”。
注意:如果您想接收此线程的相关电子邮件通知,请按照我们文档中的步骤启用电子邮件通知
我正在尝试使用以下 API 从桌面应用程序打印:
当我使用 Visual Studio 2022 调试器运行应用程序时,StartDoc() 会引发异常,如下图所示。但是,当我直接运行.exe文件时,它可以正常工作。您能否解释一下 VS2022 调试器这种行为背后的原因?
// Output window
Print.PrintSupport.Source.dll!00007FF8189A0417: ReturnHr(1) tid(3cd8) 80070490 Element not found.
Msg:[onecoreuap\printscan\print\workflow\printsupport\dll\printsupportutil.cpp(574)\Print.PrintSupport.Source.dll!00007FF818975BA8: (caller: 00007FF818986287) Exception(1) tid(3cd8) 80070490 Element not found.
]
Print.PrintSupport.Source.dll!00007FF818977238: LogHr(1) tid(3cd8) 80070490 Element not found.
Exception thrown at 0x00007FF84DA95B0C (KernelBase.dll) in TWTallySCPNative.exe: WinRT originate error - 0x80070490 : 'Element not found.'.
Exception thrown at 0x00007FF84DA95B0C in TWTallySCPNative.exe: Microsoft C++ exception: winrt::hresult_error at memory location 0x000000DED81FC470.
你好,
欢迎来到 Microsoft Q&A!
我建议您可以忽略该异常:Debug -> Windows -> Exception Settings,C++ Exception,然后取消选中winrt::hresult_error。
如果答案是正确的解决方案,请单击“接受答案”并请投赞成票。如果您对此答案有其他疑问,请点击“评论”。
注意:如果您想接收此线程的相关电子邮件通知,请按照我们文档中的步骤启用电子邮件通知