Print.PrintSupport.Source.dll Exception(1) Element Not Found Calling CDC::StartDoc - printing

I'm hoping someone can help point me in the right direction here. I have a VS2008 application that I've been porting over to VS2022. It has been a mostly painless excercise. But printing crashes. Previews work fine but actual printing crashes in the CDC::StartDoc() call.
This code works just fine in the vs2008 code and hasn't been changed in the vs2022 code. I'm guessing I'm missing an include or library or something but don't know what I'm missing?
This is the debugger output:
onecoreuap\printscan\print\workflow\printsupport\dll\printsupportutil.cpp(573)\Print.PrintSupport.Source.dll!7AC3BA60: (caller: 7AC26A2B) Exception(1) tid(7094) 80070490 Element not found.
Exception thrown at 0x75A37402 in IPC2000.exe: Microsoft C++ exception: wil::ResultException at memory location 0x06B6E4AC.
Exception thrown at 0x75A37402 in IPC2000.exe: Microsoft C++ exception: wil::ResultException at memory location 0x06B6DA50.
Exception thrown at 0x75A37402 in IPC2000.exe: Microsoft C++ exception: wil::ResultException at memory location 0x0018BA70.
Exception thrown at 0x75A37402 in IPC2000.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000.
Print.PrintSupport.Source.dll!7AC19ED8: ReturnHr(1) tid(6770) 80070490 Element not found.
Msg:[onecoreuap\printscan\print\workflow\printsupport\dll\printsupportutil.cpp(573)\Print.PrintSupport.Source.dll!7AC3BA60: (caller: 7AC26A2B) Exception(1) tid(6770) 80070490 Element not found.
]
Print.PrintSupport.Source.dll!7AC151F7: LogHr(1) tid(6770) 80070490 Element not found.
Exception thrown at 0x75A37402 (KernelBase.dll) in IPC2000.exe: WinRT originate error - 0x80070490 : 'Element not found.'.
Exception thrown at 0x75A37402 in IPC2000.exe: Microsoft C++ exception: winrt::hresult_error at memory location 0x0018BBC8.

Related

iOS swift CTFontManagerRegisterGraphicsFont vs CTFontManagerRegisterFontsForURL

I am using CTFontManagerRegisterGraphicsFont to register CGFont loaded at runtime from various sources (files, memory, ..), but some fonts raises an Exception with the following message:
Exception: "*** -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[0]"
an alternative to CTFontManagerRegisterGraphicsFont is CTFontManagerRegisterFontsForURL:
using this function I did not have any exception raised.
My Questions:
What is the cause of this behavior difference
How to catch & discard the exception raised by CTFontManagerRegisterGraphicsFont
Is there any thing to be done before calling CTFontManagerRegisterGraphicsFont to prevent the exception.
What .persistent scope mean for 2nd parameter in CTFontManagerRegisterFontsForURL.

C++ Builder 10.3 Rio - Existing and working projects started throwing exceptions on build

C++ Builder started throwing the following exception on all existing and working applications:
From CPU window: 50159CEE 83780800 cmp dword ptr [eax+$08],$00
From Event Log: First chance exception at $50159CEE. Exception class $C0000005 with message 'access violation at 0x50159cee: read of address 0x00000008'. Process blahblah.exe (9688)
I'm guessing this is a compiler related issue, but I have no idea how to fix it. Tried to toggle "Use classic Borland compiler", didn't help.
Solved by unchecking:
Link with runtime packages,
Link with dynamic RTL
(They were both false, but for some reason they went true)

Azure KeyVault: Exceptions when using GetSecretAsync

In development mode, on my local machine VS2017 15.7.5, I'm using
Asp.Net MVC Core 2.1
Azure KeyVault 3.0.0
AppAuthentication 1.1.0-preview
I've built a separate project used to get secrets from the vault, adding logging and other stuff. I reference that project from my MVC project.
When I launch the site I get:
Exception thrown: 'System.IO.FileLoadException' in Microsoft.AspNetCore.Hosting.dll
Which I can't track down.
{EDIT: I found this, it as a bad reference in the CSPROJ. Everything else remains the same.}
I instantiate a AzureServiceTokenProvider like this:
_provider = new AzureServiceTokenProvider();
_client = new KeyVaultClient(new KeyVaultClient
.AuthenticationCallback(_provider.KeyVaultTokenCallback));
and then I use it like this:
try
{
var secretBundle = await _client
.GetSecretAsync(_config[$"{SecretUrlsKey}:{secretName}"])
.ConfigureAwait(false);
Debug.WriteLine("Secret retrieved from vault ...");
_secretCache.Add(secretName, secretBundle.Value);
return secretBundle?.Value;
}
catch (Exception e)
...
I then I get a flurry of errors (none of which are returned to my code). Like these:
Exception thrown: 'Microsoft.Rest.TransientFaultHandling.HttpRequestWithStatusException' in Microsoft.Rest.ClientRuntime.dll
Exception thrown: 'Microsoft.Rest.TransientFaultHandling.HttpRequestWithStatusException' in System.Private.CoreLib.dll
Exception thrown: 'System.Net.Sockets.SocketException' in System.Private.CoreLib.dll
Exception thrown: 'System.Net.Http.HttpRequestException' in System.Net.Http.dll
Exception thrown: 'System.Net.Http.HttpRequestException' in System.Private.CoreLib.dll
Exception thrown: 'System.Net.Http.HttpRequestException' in System.Private.CoreLib.dll
Exception thrown: 'System.Net.Http.HttpRequestException' in System.Net.Http.dll
Exception thrown: 'System.Net.Http.HttpRequestException' in System.Private.CoreLib.dll
Exception thrown: 'System.Net.Http.HttpRequestException' in System.Private.CoreLib.dll
Exception thrown: 'System.Net.Http.HttpRequestException' in System.Private.CoreLib.dll
Exception thrown: 'System.Net.Http.HttpRequestException' in System.Net.Http.dll
Exception thrown: 'System.Net.Http.HttpRequestException' in System.Private.CoreLib.dll
Exception thrown: 'Microsoft.Azure.Services.AppAuthentication.AzureServiceTokenProviderException' in Microsoft.Azure.Services.AppAuthentication.dll
Exception thrown: 'Microsoft.Azure.Services.AppAuthentication.AzureServiceTokenProviderException' in System.Private.CoreLib.dll
Exception thrown: 'Microsoft.Azure.Services.AppAuthentication.AzureServiceTokenProviderException' in System.Private.CoreLib.dll
Eventually I get the value I'm looking for, but this seems a little wonky.
FWIW, I have had zero success deploying it to Azure.
Anyone have any ideas about any of this?
TIA
As for the second problem, it happened to me on two different machines. With no real scientific analysis (no time for that) my hunch is that the dotnet core update that allows you to run VS while it installs is causing the problem.
In the end, I used the Visual Studio Installer repair option and the problem went away. Something must have been corrupted.
Don't forget to backup your extensions and settings, cause the repair will nuke all that.
Nuget package clearing and reinstalling did nothing.

Unknown Null pointer exception at line ( -1 )

I have the following null pointer exception, I am unable to debug that due to insufficient stack trace, the exception I am getting as following,
Exception stack trace :
org.codehaus.groovy.grails.web.errors.GrailsWrappedRuntimeException#3855a1c
className=Unknown lineNumber=-1
stackTrace=java.lang.NullPointerException codeSnippet=[] gspFile=null
cause=java.lang.NullPointerException
resolver=org.springframework.core.io.support.PathMatchingResourcePatternResolver#27dee612
stackTraceLines=[java.lang.NullPointerException ] fileName=null
detailMessage=null cause=java.lang.NullPointerException stackTrace=[]
suppressedExceptions=[]
My application is working fine, but I'm continuously receiving this exception in email, I am not able to debug this issue, any help is appreciated!

Find the root cause of a first chance exception [duplicate]

I have a project that runs perfect under windows xp.
Now I have tried to run it under Windows 7 and got there a lot of exceptions under Immediate window.
A first chance exception of type 'System.ArgumentNullException' occurred in Microsoft.VisualBasic.dll
A first chance exception of type 'System.IO.FileNotFoundException' occurred in LP_Wizard.exe
A first chance exception of type 'System.ArgumentException' occurred in LP_Wizard.exe
A first chance exception of type 'System.NullReferenceException' occurred in LP_Wizard.exe
A first chance exception of type 'System.InvalidCastException' occurred in Microsoft.VisualBasic.dll
A first chance exception of type 'System.ArgumentNullException' occurred in Microsoft.VisualBasic.dll
A first chance exception of type 'System.IO.FileNotFoundException' occurred in LP_Wizard.exe
A first chance exception of type 'System.InvalidCastException' occurred in Microsoft.VisualBasic.dll
A first chance exception of type 'System.ArgumentNullException' occurred in Microsoft.VisualBasic.dll
A first chance exception of type 'System.IO.FileNotFoundException' occurred in LP_Wizard.exe
A first chance exception of type 'System.ArgumentNullException' occurred in Microsoft.VisualBasic.dll
A first chance exception of type 'System.IO.FileNotFoundException' occurred in LP_Wizard.exe
Any idea what wrong with that Microsoft.VisualBasic.dll in windows 7 and how i correct that problem ?
Thanks a lot for help .
If you want to pinpoint where the exceptions are occurring, you can select the Debug->Exceptions menu item, and in the dialog that appears, check the first checkbox for "Common Language Runtime Exceptions". This will make the debugger break as soon as an exception occurs instead of only breaking on unhandled exceptions.
This is also one reason why it is generally a bad idea to catch generic exceptions unless you are clearly logging the information caught.
What is happening is the debugger can "see" exceptions as soon as they are raised (hence the "first chance") before any catch block is hit. Any exception which is not handled by a catch block is considered a "second chance" exception and will break normally.
If these exceptions aren't stopping the running of your application because they are unhandled then you are probably OK. Most of the time the exception is handled by code and this isn't a problem. The output is simply Visual Studio letting you know the exceptions were raised.
See the "Avoiding first chance exception messages when the exception is safely handled" question for some methods to reduce this if there are too many to ignore.
Are your in the debugger? Are these exceptions your program is handling? If so you need to find a setting that tells VB to supress warning you of handled exceptions. Maybey this was set when installed on XP but not when you installed on W7. See if this helps:
http://www.helixoft.com/blog/archives/24

Resources