I am attempting to print from a Desktop application using the following APIs:
- StartDoc (...)
- StartPage (...)
- TextOut (...)
When I run my application using Visual Studio 2022 Debugger, StartDoc() throws an exception as shown in the image below. However, when I run the .exe file directly, it works without any issues. Could you please explain the reason behind this behavior of the VS2022 Debugger?"
// 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.